Skip to content

Commit

Permalink
Fix flaky variant_override spec
Browse files Browse the repository at this point in the history
It looks like #preload doesn't work nicely on associated objects with the acts_as_paranoid gem, but #includes might work better?
  • Loading branch information
Matt-Yorkley committed Jul 7, 2020
1 parent 3d955a9 commit b8473ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/variant_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class VariantOverride < ActiveRecord::Base
localize_number :price

def self.indexed(hub)
for_hubs(hub).preload(:variant).index_by(&:variant)
for_hubs(hub).includes(:variant).index_by(&:variant)
end

def stock_overridden?
Expand Down

0 comments on commit b8473ec

Please sign in to comment.