aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/named_scope.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-06-13 01:01:42 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2009-06-12 16:14:06 -0700
commitd32965399ccfa2052a4d52b70db1bae0ca16830b (patch)
tree7f41b1846efd2d11d7ebff15a115cba02ad75f11 /activerecord/lib/active_record/named_scope.rb
parent54a5446641e4386285231385700b95a223931bff (diff)
downloadrails-d32965399ccfa2052a4d52b70db1bae0ca16830b.tar.gz
rails-d32965399ccfa2052a4d52b70db1bae0ca16830b.tar.bz2
rails-d32965399ccfa2052a4d52b70db1bae0ca16830b.zip
uses Object#metaclass and Object#class_eval in a few spots
[#2797 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib/active_record/named_scope.rb')
-rw-r--r--activerecord/lib/active_record/named_scope.rb3
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