Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 09, 2012
@shayfrendt shayfrendt Replace 'with_exclusive_scope' with 'unscoped' b23010e
@shayfrendt shayfrendt with_revisions is not a valid key for associations
- This is a failing test to show that this behavior does not work as
  expected on Rails 3. The override of the find method in revisable.rb
  no longer works because of the way Rails 3 does collection proxies now
  whereas it used to just do collection associations
0b321f9
View
4 lib/acts_as_revisable/acts/revisable.rb
@@ -419,7 +419,7 @@ def with_scope(*args, &block) #:nodoc:
options = (args.grep(Hash).first || {})[:find]
if options && options.delete(:with_revisions)
- with_exclusive_scope do
+ unscoped do
super(*args, &block)
end
else
@@ -437,7 +437,7 @@ def find(*args) #:nodoc:
options = args.grep(Hash).first
if options && options.delete(:with_revisions)
- with_exclusive_scope do
+ unscoped do
super(*args)
end
else
View
5 spec/acts_as_revisable/associations_spec.rb
@@ -19,4 +19,9 @@
it "should return all the revisions" do
@project.revisions.size.should == 3
end
+
+ it "should allow :with_revisions key for associations" do
+ Person.create(:name => "Peter", :project => @project)
+ lambda { @project.people.find(:first, :with_revisions => true) }.should_not raise_error
+ end
end

No commit comments for this range

Something went wrong with that request. Please try again.