Module: PaperclipI18n::HasManyAttachedFiles::ClassMethods
- Defined in:
- lib/paperclip_i18n/has_many_attached_files.rb
Instance Method Summary collapse
-
#has_many_attached_files(options = {}) ⇒ Object
Extends the model to afford the ability to associate other records with the receiving record.
Instance Method Details
#has_many_attached_files(options = {}) ⇒ Object
Extends the model to afford the ability to associate other records with the receiving record.
This module needs the paperclip plugin to work www.thoughtbot.com/projects/paperclip
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/paperclip_i18n/has_many_attached_files.rb', line 12 def has_many_attached_files( = {}) class_attribute(:has_many_attached_files_options) self. = { :counter_cache => [:counter_cache], :styles => [:styles], :model => [:model] ||= ::Asset } attr_accessor(:upload) attr_accessor(:current_file_language) after_save(:save_attached_files) has_many(:assets, :as => :attachable, :dependent => :destroy, :class_name => self.[:model].to_s) include(::PaperclipI18n::HasManyAttachedFiles::InstanceMethods) end |