2012-08-09 19:59:35 -07:00
|
|
|
class ContributionObserver < ActiveRecord::Observer
|
2012-12-29 22:46:36 -08:00
|
|
|
include FragmentExpiration
|
|
|
|
|
2012-08-09 19:59:35 -07:00
|
|
|
def after_create(contribution)
|
2012-10-24 20:09:05 -07:00
|
|
|
if contribution.contributed_type == 'SwfAsset'
|
|
|
|
item = contribution.contributed.item
|
2012-12-30 11:15:55 -08:00
|
|
|
expire_fragment_in_all_locales("items/#{item.id} contributors")
|
2012-10-24 20:09:05 -07:00
|
|
|
end
|
2012-08-09 19:59:35 -07:00
|
|
|
end
|
|
|
|
end
|