We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aee3ec3 commit 66e25afCopy full SHA for 66e25af
activerecord/lib/active_record/scoping/named.rb
@@ -193,7 +193,7 @@ def singleton_method_added(name)
193
# Most Kernel extends are both singleton and instance methods so
194
# respond_to is a fast check, but we don't want to define methods
195
# only on the module (ex. Module#name)
196
- generate_relation_method(name) if Kernel.respond_to?(name) && (Kernel.instance_methods | Kernel.private_instance_methods).include?(name) && !ActiveRecord::Relation.method_defined?(name)
+ generate_relation_method(name) if Kernel.respond_to?(name) && (Kernel.method_defined?(name) || Kernel.private_method_defined?(name)) && !ActiveRecord::Relation.method_defined?(name)
197
end
198
199
0 commit comments