aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/named_scope.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-02-25 09:32:29 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2010-02-25 09:32:29 -0800
commitf7b0a857e97304a5daeb47313759b9bf0d7e2fc9 (patch)
tree81bda0d86cc1d22e3e8c50e5e852d200aec7be57 /activerecord/lib/active_record/named_scope.rb
parent6b12d74026808a3014f1dff34481006a96e0f18f (diff)
downloadrails-f7b0a857e97304a5daeb47313759b9bf0d7e2fc9.tar.gz
rails-f7b0a857e97304a5daeb47313759b9bf0d7e2fc9.tar.bz2
rails-f7b0a857e97304a5daeb47313759b9bf0d7e2fc9.zip
Use Object#singleton_class instead of #metaclass. Prefer Ruby's choice.
Diffstat (limited to 'activerecord/lib/active_record/named_scope.rb')
-rw-r--r--activerecord/lib/active_record/named_scope.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb
index ff6c041ef4..f1f56850ae 100644
--- a/activerecord/lib/active_record/named_scope.rb
+++ b/activerecord/lib/active_record/named_scope.rb
@@ -1,6 +1,6 @@
require 'active_support/core_ext/array'
require 'active_support/core_ext/hash/except'
-require 'active_support/core_ext/object/metaclass'
+require 'active_support/core_ext/object/singleton_class'
module ActiveRecord
module NamedScope
@@ -112,7 +112,7 @@ module ActiveRecord
options.call(*args)
end, &block)
end
- metaclass.instance_eval do
+ singleton_class.instance_eval do
define_method name do |*args|
scopes[name].call(self, *args)
end