aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2007-10-03 21:48:49 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2007-10-03 21:48:49 +0000
commit406ea8f31db6ee8c74890e2f3f36217f07480892 (patch)
tree64499ca4768dd9d48d2fbe2bffda41c6432a82f2 /activerecord
parentb31aa639e7c8a1f510b8df5e7c57d23440a9a765 (diff)
downloadrails-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')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb15
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