diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-05-03 12:18:25 -0400 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-15 09:48:49 +0200 |
commit | 58adc6737126242d189274d83c50bcade098800a (patch) | |
tree | de40fedc3fa29f49cc6af5c4109ca326c09bfedf /activerecord/lib/active_record/named_scope.rb | |
parent | bcf5fea5e5a22edd5c7b27c29a53de0a4bedbc27 (diff) | |
download | rails-58adc6737126242d189274d83c50bcade098800a.tar.gz rails-58adc6737126242d189274d83c50bcade098800a.tar.bz2 rails-58adc6737126242d189274d83c50bcade098800a.zip |
STI should not ignore type condition while applying scopes from parent class scopes
[#4507 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/named_scope.rb')
-rw-r--r-- | activerecord/lib/active_record/named_scope.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index aeed52e72a..3d8f4a030b 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -99,11 +99,7 @@ module ActiveRecord block_given? ? relation.extending(Module.new(&block)) : relation end - singleton_class.instance_eval do - define_method name do |*args| - scopes[name].call(*args) - end - end + singleton_class.send :define_method, name, &scopes[name] end def named_scope(*args, &block) |