module ExpiringAssetLinks::InstanceMethods

Protected Instance Methods

add_asset_tags(attribute) click to toggle source
   # File lib/expiring_asset_links.rb
49 def add_asset_tags(attribute)
50   linked_attribute = self[attribute.to_sym].gsub(/([A-Za-z]+)\{\{(\d+)\}\}/) { $1.constantize.find($2).send($1.constantize.uploaders.keys.first).url(:default) }
51 end
remove_all_asset_tags!() click to toggle source
   # File lib/expiring_asset_links.rb
53 def remove_all_asset_tags!
54   self.class.expiring_asset_link_attributes.each{ |attribute| self.send(:"#{attribute}=", remove_asset_tags(attribute.to_sym)) }
55 end
remove_asset_tags(attribute) click to toggle source
   # File lib/expiring_asset_links.rb
45 def remove_asset_tags(attribute)
46   ExpiringAssetLinks.remove_asset_tags(self[attribute.to_sym])
47 end