Open

Description
I have the following setup:
class SalesAd
has_one :district, through: :wine
counter_culture :district, column_name: :active_sales_ads_count, delta_magnitude: proc { |model| model.state == "active" ? 1 : 0 }
end
I am then speccing it like this:
sales_ad
expect(district.reload.active_sales_ads_count).to eq 0
sales_ad.update!(state: "active")
expect(district.reload.active_sales_ads_count).to eq 1
Which fails with expected: 1 got: 0
.
I would expect counter culture to notice the change and change the weight from 0 to 1 and add the change in weight to the active_sales_ads_count
column on the district.
Metadata
Assignees
Labels
No labels