Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Scope#current_scoped_methods_when_defined is no longer needed

  • Loading branch information...
commit 0be31f85639cf2f536c558819ef3ee45ba7d83a3 1 parent 1cd3d29
@lifo lifo authored
Showing with 2 additions and 13 deletions.
  1. +2 −13 activerecord/lib/active_record/named_scope.rb
View
15 activerecord/lib/active_record/named_scope.rb
@@ -128,8 +128,6 @@ def named_scope(*args, &block)
end
class Scope < Relation
- attr_accessor :current_scoped_methods_when_defined
-
delegate :scopes, :with_scope, :with_exclusive_scope, :scoped_methods, :scoped, :to => :klass
def self.init(klass, options, &block)
@@ -141,10 +139,7 @@ def self.init(klass, options, &block)
options ? klass.scoped.merge(options) : klass.scoped
end
- relation = relation.merge(scope)
-
- relation.current_scoped_methods_when_defined = klass.send(:current_scoped_methods)
- relation
+ relation.merge(scope)
end
def first(*args)
@@ -178,13 +173,7 @@ def ==(other)
def method_missing(method, *args, &block)
if klass.respond_to?(method)
- with_scope(self) do
- if current_scoped_methods_when_defined && !scoped_methods.include?(current_scoped_methods_when_defined) && !scopes.include?(method)
- with_scope(current_scoped_methods_when_defined) { klass.send(method, *args, &block) }
- else
- klass.send(method, *args, &block)
- end
- end
+ with_scope(self) { klass.send(method, *args, &block) }
else
super
end
Please sign in to comment.
Something went wrong with that request. Please try again.