diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-29 12:31:08 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-29 12:31:08 +0530 |
commit | 981f69639841759a558a0083cd507fa610d564ad (patch) | |
tree | 24a7dc34bda6f7e893c5289162f45dced9ddae61 /activerecord/lib | |
parent | bc933d0fa1b3a89deaf3e7c74d7717eb8fc7152a (diff) | |
download | rails-981f69639841759a558a0083cd507fa610d564ad.tar.gz rails-981f69639841759a558a0083cd507fa610d564ad.tar.bz2 rails-981f69639841759a558a0083cd507fa610d564ad.zip |
Relation#respond_to? should take second argument for responding to private methods
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index d7cd78593f..b82a7d44f7 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -142,8 +142,8 @@ module ActiveRecord create_new_relation(@relation.where(conditions)) end - def respond_to?(method) - return true if @relation.respond_to?(method) || Array.method_defined?(method) + def respond_to?(method, include_private = false) + return true if @relation.respond_to?(method, include_private) || Array.method_defined?(method) if match = DynamicFinderMatch.match(method) return true if @klass.send(:all_attributes_exists?, match.attribute_names) |