Skip to content

Commit

Permalink
add check before N+1 notification publish to prevent poly association…
Browse files Browse the repository at this point in the history
… with nil type to be include
  • Loading branch information
wendy-clio committed Jun 7, 2024
1 parent 41abfe4 commit 091f920
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 296 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.1
- name: Install dependencies
run: bundle install
- name: Run tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Ruby 2.7
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.1

- name: Publish to RubyGems
env:
Expand Down
6 changes: 0 additions & 6 deletions Gemfile.5.2

This file was deleted.

72 changes: 0 additions & 72 deletions Gemfile.5.2.lock

This file was deleted.

6 changes: 0 additions & 6 deletions Gemfile.6.0

This file was deleted.

72 changes: 0 additions & 72 deletions Gemfile.6.0.lock

This file was deleted.

7 changes: 1 addition & 6 deletions lib/jit_preloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
if Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("7.0.0")
require 'jit_preloader/active_record/associations/preloader/ar7_association'
require 'jit_preloader/active_record/associations/preloader/ar7_branch'
elsif Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("6.0.0")
elsif Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("6.1.0")
require 'jit_preloader/active_record/associations/preloader/ar6_association'
elsif Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("5.2.2")
require 'jit_preloader/active_record/associations/preloader/ar5_association'
else
require 'jit_preloader/active_record/associations/preloader/collection_association'
require 'jit_preloader/active_record/associations/preloader/singular_association'
end
require 'jit_preloader/preloader'

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def load_target
end
end
end

private def not_a_polymorphic_association_with_missing_type
!(self.is_a?(ActiveRecord::Associations::BelongsToPolymorphicAssociation) && self.klass.nil?)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/jit_preloader/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module JitPreloader
VERSION = "2.1.0"
VERSION = "3.0.0"
end

0 comments on commit 091f920

Please sign in to comment.