Files

Class/Module Index [+]

Quicksearch

Paperclip::Schema::Statements

Public Instance Methods

add_attachment(table_name, *attachment_names) click to toggle source
# File lib/paperclip/schema.rb, line 22
def add_attachment(table_name, *attachment_names)
  raise ArgumentError, "Please specify attachment name in your add_attachment call in your migration." if attachment_names.empty?

  attachment_names.each do |attachment_name|
    COLUMNS.each_pair do |column_name, column_type|
      add_column(table_name, "#{attachment_name}_#{column_name}", column_type)
    end
  end
end
drop_attached_file(*args) click to toggle source
# File lib/paperclip/schema.rb, line 42
def drop_attached_file(*args)
  ActiveSupport::Deprecation.warn "Method `drop_attached_file` in the migration has been deprecated and will be replaced by `remove_attachment`."
  remove_attachment(*args)
end
remove_attachment(table_name, *attachment_names) click to toggle source
# File lib/paperclip/schema.rb, line 32
def remove_attachment(table_name, *attachment_names)
  raise ArgumentError, "Please specify attachment name in your remove_attachment call in your migration." if attachment_names.empty?

  attachment_names.each do |attachment_name|
    COLUMNS.each_pair do |column_name, column_type|
      remove_column(table_name, "#{attachment_name}_#{column_name}")
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.