Skip to content

Commit

Permalink
Merge f289d04 into 12a37ea
Browse files Browse the repository at this point in the history
  • Loading branch information
jturkel committed Nov 5, 2018
2 parents 12a37ea + f289d04 commit 28a9f5a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### 3.0.2
- Fix destroyed model eager loading which accidentally broke in [#74](https://github.com/salsify/goldiloader/pull/74).

### 3.0.1
- Enable eager loading of associations on destroyed models in all versions of Rails except 5.2.0 since
Rails issue [32375](https://github.com/rails/rails/pull/32375) has been fixed.
Expand Down
2 changes: 1 addition & 1 deletion lib/goldiloader/compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.rails_5_0?

# See https://github.com/rails/rails/pull/32375
def self.destroyed_model_associations_eager_loadable?
RAILS_5_2_0
!RAILS_5_2_0
end

def self.from_eager_loadable?
Expand Down
2 changes: 1 addition & 1 deletion lib/goldiloader/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Goldiloader
VERSION = '3.0.1'
VERSION = '3.0.2'
end
10 changes: 2 additions & 8 deletions spec/goldiloader/goldiloader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,14 +528,8 @@
expect(@blog_after_destroy).to eq blog1
end

if ::Goldiloader::Compatibility.destroyed_model_associations_eager_loadable?
it "auto eager loads the associations on other models" do
expect(other_post.association(:blog)).to be_loaded
end
else
it "doesn't auto eager loads associations on other models" do
expect(other_post.association(:blog)).not_to be_loaded
end
it "auto eager loads the associations on other models" do
expect(other_post.association(:blog)).to be_loaded
end
end

Expand Down

0 comments on commit 28a9f5a

Please sign in to comment.