Skip to content

Commit

Permalink
Fix Rails 4.0 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jturkel committed Apr 19, 2015
1 parent 9432d07 commit 8e6aea3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/goldiloader/goldiloader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
expect(blogs.first.posts_ordered_by_author.map(&:author).map(&:name)).to eq sorted_post_authors
end

if ActiveRecord.gem_version >= Gem::Version.new('4.2')
if Goldiloader::Compatibility.joins_eager_loadable?
it_behaves_like "it auto eager loads the association", :posts_ordered_by_author
else
it_behaves_like "it doesn't auto eager the association", :posts_ordered_by_author
Expand All @@ -400,7 +400,7 @@
expect(blogs.first.posts_ordered_by_author.map(&:author).map(&:address).map(&:city)).to eq sorted_post_cities
end

if ActiveRecord.gem_version >= Gem::Version.new('4.2')
if Goldiloader::Compatibility.joins_eager_loadable?
it_behaves_like "it auto eager loads the association", :authors_with_join
else
it_behaves_like "it doesn't auto eager the association", :authors_with_join
Expand Down

0 comments on commit 8e6aea3

Please sign in to comment.