impress/app/models/contribution_observer.rb

11 lines
299 B
Ruby
Raw Normal View History

2012-08-09 19:59:35 -07:00
class ContributionObserver < ActiveRecord::Observer
include FragmentExpiration
2012-08-09 19:59:35 -07:00
def after_create(contribution)
if contribution.contributed_type == 'SwfAsset'
item = contribution.contributed.item
expire_fragment_in_all_locales("items/#{item.id} contributors")
end
2012-08-09 19:59:35 -07:00
end
end