impress/app/models/contribution_observer.rb
Matchu c9e00f1d7c Stop caching latest contribution
That's another tiny query that I'm okay with just removing the cache overhead complexity for right now!
2023-08-02 12:04:09 -07:00

10 lines
299 B
Ruby

class ContributionObserver < ActiveRecord::Observer
include FragmentExpiration
def after_create(contribution)
if contribution.contributed_type == 'SwfAsset'
item = contribution.contributed.item
expire_fragment_in_all_locales("items/#{item.id} contributors")
end
end
end