Module: Paperclip::Schema::Statements
- Defined in:
- lib/paperclip/schema.rb
Instance Method Summary (collapse)
- - (Object) add_attachment(table_name, *attachment_names)
- - (Object) drop_attached_file(*args)
- - (Object) remove_attachment(table_name, *attachment_names)
Instance Method Details
- (Object) add_attachment(table_name, *attachment_names)
22 23 24 25 26 27 28 29 30 |
# File 'lib/paperclip/schema.rb', line 22 def (table_name, *) raise ArgumentError, "Please specify attachment name in your add_attachment call in your migration." if .empty? .each do || COLUMNS.each_pair do |column_name, column_type| add_column(table_name, "#{}_#{column_name}", column_type) end end end |
- (Object) drop_attached_file(*args)
42 43 44 45 |
# 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`." (*args) end |
- (Object) remove_attachment(table_name, *attachment_names)
32 33 34 35 36 37 38 39 40 |
# File 'lib/paperclip/schema.rb', line 32 def (table_name, *) raise ArgumentError, "Please specify attachment name in your remove_attachment call in your migration." if .empty? .each do || COLUMNS.each_pair do |column_name, column_type| remove_column(table_name, "#{}_#{column_name}") end end end |