diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-09-13 23:46:43 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-09-14 00:00:37 +0100 |
commit | 778c82bea69eb15908a8bb77999ceac0a749242d (patch) | |
tree | 618649132da64c2194d492410b6e7ac6475e2160 /activemodel/lib/active_model | |
parent | 55da28dd2fa734de256a13fb09469eaa3ab15599 (diff) | |
download | rails-778c82bea69eb15908a8bb77999ceac0a749242d.tar.gz rails-778c82bea69eb15908a8bb77999ceac0a749242d.tar.bz2 rails-778c82bea69eb15908a8bb77999ceac0a749242d.zip |
Generate attribute method unless it's already in the module.
There's no harm in generating a method name that's already defined on
the host class, since we're generating the attribute methods in a module
that gets included. In fact, this is desirable as it allows the host
class to call super.
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 539e0bbdda..a201e983cd 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -329,7 +329,7 @@ module ActiveModel protected def instance_method_already_implemented?(method_name) - method_defined?(method_name) + generated_attribute_methods.method_defined?(method_name) end private |