Skip to content

Commit

Permalink
Fix: owner variable cannot be Hash anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
khiav223577 committed Dec 24, 2023
1 parent 171401c commit bd7733a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/deep_pluck/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def get_foreign_key(reflect, reverse: false, with_table_name: false)
end

def get_association_scope(reflect)
RailsCompatibility.unscope_where(reflect.association_class.new({}, reflect).send(:association_scope))
owner = reflect.association_class.new(reflect.active_record.new, reflect)
return RailsCompatibility.unscope_where(owner.send(:association_scope))
end

def use_association_to_query?(reflect)
Expand Down

0 comments on commit bd7733a

Please sign in to comment.