Skip to content
Snippets Groups Projects
Commit cb5dadd8 authored by Matheus Agio Nerone's avatar Matheus Agio Nerone
Browse files

migrating thumbnail to paperclip


Signed-off-by: default avatarman13 <man13@inf.ufpr.br>
parent c57948fb
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ class LearningObject < ActiveRecord::Base
include Sociable
include Stateful
has_attached_file :thumbnail, styles: {medium: "530x300", small: "250x140"}
has_and_belongs_to_many :topics
has_many :collection_items, as: :collectionable
......
class RemoveStringThumbnail < ActiveRecord::Migration
def change
remove_column :learning_objects, :thumbnail, :string
end
end
class AddPaperclipThumbnail < ActiveRecord::Migration
def up
add_attachment :learning_objects, :thumbnail
end
def down
remove_attachment :learning_objects, :thumbnail
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment