Skip to content

Commit 480d620

Browse files
committed
Use Model.association_reflection in the filter-by-associations support
1 parent 2b19745 commit 480d620

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/sequel/model/associations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3063,7 +3063,7 @@ def complex_expression_sql_append(sql, op, args)
30633063
if (((op == :'=' || op == :'!=') && r.is_a?(Sequel::Model)) ||
30643064
(multiple = ((op == :IN || op == :'NOT IN') && ((is_ds = r.is_a?(Sequel::Dataset)) || (r.respond_to?(:all?) && r.all?{|x| x.is_a?(Sequel::Model)})))))
30653065
l = args[0]
3066-
if ar = model.association_reflections[l]
3066+
if ar = model.association_reflection(l)
30673067
raise Error, "filtering by associations is not allowed for #{ar.inspect}" if ar[:allow_filtering_by] == false
30683068

30693069
if multiple

0 commit comments

Comments
 (0)