class AddAvatarColumnsToUser < ActiveRecord::Migration
class AddAvatarColumnsToUsers < ActiveRecord::Migration
def self.up
change_table :users do |t|
t.has_attached_file :avatar
end
add_attachment :users, :avatar
end
def self.down
drop_attached_file :users, :avatar
remove_attachment :users, :avatar
end
end
...
...
@@ -184,7 +182,7 @@ Defaults
--------
Global defaults for all your paperclip attachments can be defined by changing the Paperclip::Attachment.default_options Hash, this can be useful for setting your default storage settings per example so you won't have to define them in every has_attached_file definition.
If you're using Rails you can define a Hash with default options in config/application.rb or in any of the config/environments/*.rb files on config.paperclip_defaults, these well get merged into Paperclip::Attachment.default_options as your Rails app boots. An example:
If you're using Rails you can define a Hash with default options in config/application.rb or in any of the config/environments/*.rb files on config.paperclip_defaults, these well get merged into Paperclip::Attachment.default_options as your Rails app boots. An example: