Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Methods invoked within named scope Procs should respect the s…

…cope stack. [#1267 state:resolved]"

This reverts commit 6a13376.

Conflicts:

	activerecord/test/cases/named_scope_test.rb
  • Loading branch information...
commit d83b1828577c268de56e1b3942e16002c9efdd57 1 parent e566fc0
@jeremy jeremy authored
View
7 activerecord/lib/active_record/named_scope.rb
@@ -92,12 +92,7 @@ def named_scope(name, options = {}, &block)
when Hash
options
when Proc
- case parent_scope
- when Scope
- with_scope(:find => parent_scope.proxy_options) { options.call(*args) }
- else
- options.call(*args)
- end
+ options.call(*args)
end, &block)
end
metaclass.instance_eval do
View
4 activerecord/test/cases/named_scope_test.rb
@@ -354,10 +354,6 @@ def test_chaining_should_use_latest_conditions_when_searching
assert_equal [posts(:sti_comments)], Post.with_special_comments.with_post(4).all.uniq
end
- def test_methods_invoked_within_scopes_should_respect_scope
- assert_equal [], Topic.approved.by_rejected_ids.proxy_options[:conditions][:id]
- end
-
def test_named_scopes_batch_finders
assert_equal 3, Topic.approved.count
View
2  activerecord/test/models/topic.rb
@@ -35,8 +35,6 @@ def extension_two
end
named_scope :named_extension, :extend => NamedExtension
named_scope :multiple_extensions, :extend => [MultipleExtensionTwo, MultipleExtensionOne]
-
- named_scope :by_rejected_ids, lambda {{ :conditions => { :id => all(:conditions => {:approved => false}).map(&:id) } }}
has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title"
Please sign in to comment.
Something went wrong with that request. Please try again.