Module: AmpleAssets::PluginMethods

Defined in:
lib/ample_assets/plugin_methods.rb

Instance Method Summary collapse

Instance Method Details

#has_asset(name = :file, options = {}) ⇒ Object



4
5
6
7
8
# File 'lib/ample_assets/plugin_methods.rb', line 4

def has_asset(name = :file, options = {})
  configuration = { :foreign_key => "#{name}_id", :class_name => 'AmpleAssets::File' }
  configuration.update(options) if options.is_a?(Hash)
  self.belongs_to name, configuration
end