Skip to content
This repository has been archived by the owner on Aug 2, 2018. It is now read-only.

Commit

Permalink
enables paperclip in theory.
Browse files Browse the repository at this point in the history
  • Loading branch information
icco committed Jun 28, 2012
1 parent b895d7f commit 0a392f6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config/boot.rb
Expand Up @@ -34,6 +34,8 @@
# Add your before (RE)load hooks here
#
Padrino.before_load do
ActiveRecord::Base.send(:include, Paperclip::Glue)
Paperclip.options[:logger] = Padrino.logger
end

##
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20120627232445_add_attachment_to_songs.rb
@@ -0,0 +1,5 @@
class AddAttachmentToSongs < ActiveRecord::Migration
def change
add_attachment :songs, :file
end
end
10 changes: 7 additions & 3 deletions db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120627231645) do
ActiveRecord::Schema.define(:version => 20120627232445) do

create_table "playlists", :force => true do |t|
t.string "name"
Expand All @@ -28,8 +28,12 @@
t.string "description"
t.integer "playlist_id"
t.integer "length"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "file_file_name"
t.string "file_content_type"
t.integer "file_file_size"
t.datetime "file_updated_at"
end

end
4 changes: 4 additions & 0 deletions models/song.rb
@@ -0,0 +1,4 @@
class Song < ActiveRecord::Base
belongs_to :playlist
has_attached_file :file
end

0 comments on commit 0a392f6

Please sign in to comment.