diff options
Diffstat (limited to 'activerecord/lib/active_record/named_scope.rb')
-rw-r--r-- | activerecord/lib/active_record/named_scope.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index 1b22fa5e24..dd2a90b8e5 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -1,5 +1,6 @@ require 'active_support/core_ext/array' require 'active_support/core_ext/hash/except' +require 'active_support/core_ext/object/metaclass' module ActiveRecord module NamedScope @@ -99,7 +100,7 @@ module ActiveRecord end end, &block) end - (class << self; self end).instance_eval do + metaclass.instance_eval do define_method name do |*args| scopes[name].call(self, *args) end |