diff options
author | José Valim <jose.valim@gmail.com> | 2010-12-27 09:30:36 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-12-27 09:30:36 +0100 |
commit | 6b099975fa7e18356b19eca659595713512209e1 (patch) | |
tree | e4dd02be7f594cb30792a232f17f71535f7216a6 /activerecord/lib/active_record | |
parent | 51a7d9acdd4a01fb23e21be7a89e6440e51715e8 (diff) | |
download | rails-6b099975fa7e18356b19eca659595713512209e1.tar.gz rails-6b099975fa7e18356b19eca659595713512209e1.tar.bz2 rails-6b099975fa7e18356b19eca659595713512209e1.zip |
No need to symbolize these.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 6aac25ba9b..f96aa8b3fb 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1490,8 +1490,10 @@ MSG attributes.each do |k, v| if k.include?("(") multi_parameter_attributes << [ k, v ] + elsif respond_to?("#{k}=") + send("#{k}=", v) else - respond_to?(:"#{k}=") ? send(:"#{k}=", v) : raise(UnknownAttributeError, "unknown attribute: #{k}") + raise(UnknownAttributeError, "unknown attribute: #{k}") end end @@ -1816,7 +1818,7 @@ MSG if scope = self.class.send(:current_scoped_methods) create_with = scope.scope_for_create create_with.each { |att,value| - respond_to?(:"#{att}=") && send("#{att}=", value) + respond_to?("#{att}=") && send("#{att}=", value) } end end |