Skip to content

Commit 66e25af

Browse files
Update activerecord/lib/active_record/scoping/named.rb
Co-authored-by: Jean byroot Boussier <[email protected]>
1 parent aee3ec3 commit 66e25af

File tree

1 file changed

+1
-1
lines changed
  • activerecord/lib/active_record/scoping

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/scoping/named.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def singleton_method_added(name)
193193
# Most Kernel extends are both singleton and instance methods so
194194
# respond_to is a fast check, but we don't want to define methods
195195
# 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)
196+
generate_relation_method(name) if Kernel.respond_to?(name) && (Kernel.method_defined?(name) || Kernel.private_method_defined?(name)) && !ActiveRecord::Relation.method_defined?(name)
197197
end
198198
end
199199
end

0 commit comments

Comments
 (0)