Skip to content

Commit

Permalink
call association also on through reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Nov 17, 2023
1 parent e147136 commit c35e9fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/bullet/active_record4.rb
Expand Up @@ -108,7 +108,7 @@ def construct_association(record, join, row)

if Bullet.start?
associations = [node.reflection.name]
if node.reflection.through_reflection?
if node.reflection.chain?
associations << node.reflection.through_reflection.name
end
associations.each do |association|
Expand Down
2 changes: 1 addition & 1 deletion lib/bullet/active_record41.rb
Expand Up @@ -111,7 +111,7 @@ def construct_model(record, node, row, model_cache, id, aliases)

if Bullet.start?
associations = [node.reflection.name]
if node.reflection.through_reflection?
if node.reflection.chain?
associations << node.reflection.through_reflection.name
end
associations.each do |association|
Expand Down
2 changes: 1 addition & 1 deletion lib/bullet/active_record42.rb
Expand Up @@ -153,7 +153,7 @@ def construct_model(record, node, row, model_cache, id, aliases)

if Bullet.start?
associations = [node.reflection.name]
if node.reflection.through_reflection?
if node.reflection.chain?
associations << node.reflection.through_reflection.name
end
associations.each do |association|
Expand Down

0 comments on commit c35e9fb

Please sign in to comment.