Module: Paperclip::Schema::TableDefinition

Defined in:
lib/paperclip/schema.rb

Instance Method Summary collapse

Instance Method Details

#attachment(*attachment_names) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/paperclip/schema.rb', line 49

def attachment(*attachment_names)
  attachment_names.each do |attachment_name|
    COLUMNS.each_pair do |column_name, column_type|
      column("#{attachment_name}_#{column_name}", column_type)
    end
  end
end

#has_attached_file(*attachment_names) ⇒ Object



57
58
59
60
# File 'lib/paperclip/schema.rb', line 57

def has_attached_file(*attachment_names)
  ActiveSupport::Deprecation.warn "Method `t.has_attached_file` in the migration has been deprecated and will be replaced by `t.attachment`."
  attachment(*attachment_names)
end