Module: Resizor::InstanceMethods

Defined in:
lib/resizor/railtie.rb

Instance Method Summary collapse

Instance Method Details

#asset_for(name) ⇒ Object



54
55
56
57
# File 'lib/resizor/railtie.rb', line 54

def asset_for name
  @resizor_assets ||= {}
  @resizor_assets[name] ||= Resizor::AttachedResizorAsset.new(name, self, self.class.resizor_assets[name])
end

#delete_attached_files_on_resizorObject



65
66
67
68
69
# File 'lib/resizor/railtie.rb', line 65

def delete_attached_files_on_resizor
  self.class.resizor_assets.each do |name, options|
    asset_for(name).send(:destroy)
  end
end

#save_attached_files_for_resizorObject



59
60
61
62
63
# File 'lib/resizor/railtie.rb', line 59

def save_attached_files_for_resizor
  self.class.resizor_assets.each do |name, options|
    asset_for(name).send(:save)
  end
end