Module: ActiveRecord::AttributeConverter::PredicateBuilder
- Defined in:
- lib/activerecord/attribute_converter/predicate_builder.rb
Instance Method Summary collapse
-
#build_from_hash_with_attribute_converter(*args) ⇒ Object
Rails 3.2: build_from_hash(engine, attributes, default_table, allow_table_name = true) Rails 4.0: build_from_hash(klass, attributes, default_table) Rails 4.1: build_from_hash(klass, attributes, default_table).
Instance Method Details
#build_from_hash_with_attribute_converter(*args) ⇒ Object
Rails 3.2: build_from_hash(engine, attributes, default_table, allow_table_name = true) Rails 4.0: build_from_hash(klass, attributes, default_table) Rails 4.1: build_from_hash(klass, attributes, default_table)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/activerecord/attribute_converter/predicate_builder.rb', line 7 def build_from_hash_with_attribute_converter(*args) klass = args[0] unless klass.attribute_converters.empty? attributes = args[1].stringify_keys klass.attribute_converters.each do |attr, converter| if attributes.has_key?(attr) attributes[attr] = converter.internalize(attributes[attr]) end end args[1] = attributes end build_from_hash_without_attribute_converter(*args) end |