diff options
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/primary_key.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/primary_key.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb index 746682393e..e3c7344f59 100644 --- a/activerecord/lib/active_record/attribute_methods/primary_key.rb +++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb @@ -30,10 +30,10 @@ module ActiveRecord if attr_name == primary_key && attr_name != 'id' generated_attribute_methods.send(:alias_method, :id, primary_key) - generated_attribute_methods.module_eval <<-CODE, __FILE__, __LINE__ - def self.attribute_id(v, attributes, attributes_cache, attr_name) + generated_external_attribute_methods.module_eval <<-CODE, __FILE__, __LINE__ + def id(v, attributes, attributes_cache, attr_name) attr_name = '#{primary_key}' - send(:'attribute_#{attr_name}', attributes[attr_name], attributes, attributes_cache, attr_name) + send(attr_name, attributes[attr_name], attributes, attributes_cache, attr_name) end CODE end |