Performs any necessary step after an update This can be useful to handle the asset special attribute :resource
# File vendor/plugins/ubiquo_media/lib/ubiquo_media/connectors/i18n.rb, line 61
61: def uhook_after_update
62: # Updates :resource in translations, if this field has been updated
63: if self.class.instance_variable_get('@original_resource_owner').blank?
64: begin
65: self.class.instance_variable_set('@original_resource_owner', self)
66: # The resource we are copying must be saved for paperclip to work correctly
67: self.resource.save
68: translations.each do |translation|
69: translation.without_updating_translations do
70: translation.resource = self.resource
71: translation.save
72: end
73: end
74: ensure
75: self.class.instance_variable_set('@original_resource_owner', nil)
76: end
77: end
78: end
Disabled; run with $DEBUG to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.