diff options
author | Tobias Lütke <tobias.luetke@gmail.com> | 2007-10-03 21:48:49 +0000 |
---|---|---|
committer | Tobias Lütke <tobias.luetke@gmail.com> | 2007-10-03 21:48:49 +0000 |
commit | 406ea8f31db6ee8c74890e2f3f36217f07480892 (patch) | |
tree | 64499ca4768dd9d48d2fbe2bffda41c6432a82f2 /activerecord/lib/active_record | |
parent | b31aa639e7c8a1f510b8df5e7c57d23440a9a765 (diff) | |
download | rails-406ea8f31db6ee8c74890e2f3f36217f07480892.tar.gz rails-406ea8f31db6ee8c74890e2f3f36217f07480892.tar.bz2 rails-406ea8f31db6ee8c74890e2f3f36217f07480892.zip |
only create custom accessors for Kernel:: methods
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7731 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 069983349a..695e9caae3 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -76,18 +76,11 @@ module ActiveRecord end end - def instance_method_already_defined?(method_name) - method_defined?(method_name) || - private_method_defined?(method_name) || - protected_method_defined?(method_name) - end - def instance_method_already_implemented?(method_name) - if instance_method_already_defined?(method_name) - # method is defined but maybe its a simple library or kernel method - # which we could simply override: - @@_overrideable_method_names ||= Set.new(Object.instance_methods + Kernel.methods) - @@_overrideable_method_names.include?(method_name) ? false : true + if method_defined?(method_name) || private_method_defined?(method_name) || protected_method_defined?(method_name) + # method is defined but maybe its a simple Kernel:: method which we could simply override + @@_overrideable_kernel_methods ||= Set.new(Kernel.methods) + !@@_overrideable_kernel_methods.include?(method_name) else false end |