diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-18 16:01:32 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-18 16:01:32 -0300 |
commit | 051747449e7afc817c599e4135bc629d4de064eb (patch) | |
tree | 724cd9c1e5041a90b0362466ff442569f271a748 /activerecord/lib/active_record/attribute_assignment.rb | |
parent | fda195d34af3cd89cf2f3de3ed653f157c76730b (diff) | |
parent | 14fc8b34521f8354a17e50cd11fa3f809e423592 (diff) | |
download | rails-051747449e7afc817c599e4135bc629d4de064eb.tar.gz rails-051747449e7afc817c599e4135bc629d4de064eb.tar.bz2 rails-051747449e7afc817c599e4135bc629d4de064eb.zip |
Merge pull request #6743 from steveklabnik/remove_composed_of
Removing composed_of
Diffstat (limited to 'activerecord/lib/active_record/attribute_assignment.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_assignment.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_assignment.rb b/activerecord/lib/active_record/attribute_assignment.rb index df4de8ac35..ab6d253ef8 100644 --- a/activerecord/lib/active_record/attribute_assignment.rb +++ b/activerecord/lib/active_record/attribute_assignment.rb @@ -132,7 +132,7 @@ module ActiveRecord private # Instantiates objects for all attribute classes that needs more than one constructor parameter. This is done - # by calling new on the column type or aggregation type (through composed_of) object with these parameters. + # by calling new on the column type or aggregation type object with these parameters. # So having the pairs written_on(1) = "2004", written_on(2) = "6", written_on(3) = "24", will instantiate # written_on (a date type) with Date.new("2004", "6", "24"). You can also specify a typecast character in the # parentheses to have the parameters typecasted before they're used in the constructor. Use i for Fixnum, @@ -167,7 +167,7 @@ module ActiveRecord end def read_value_from_parameter(name, values_hash_from_param) - klass = (self.class.reflect_on_aggregation(name.to_sym) || column_for_attribute(name)).klass + klass = column_for_attribute(name).klass if values_hash_from_param.values.all?{|v|v.nil?} nil elsif klass == Time |