Skip to content

glennpow/paperclip_migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PaperclipMigration
==================

Allows you to add paperclip attachment columns to the database using one migration line.

Example
=======

There are three methods to add the columns:

  class AddPaperclip < ActiveRecord::Migration
    def self.up
      add_column :user, :image, :attachment  # 1
      
      create_table :photos do |t|
        t.column :image, :attachment         # 2
        t.attachment :picture                # 3
      end
    end

    def self.down
      remove_attachment_column :user, :image
      drop_table :photos
    end
  end


Copyright (c) 2009 Glenn Powell, released under the MIT license

About

Allows you to add attachment columns with one migration line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published