Commit 846efdfd authored by marcheing's avatar marcheing Committed by Diego de Araújo Martinez Camarinha

Add video attachment to content model

Signed-off-by: Diego de Araújo Martinez Camarinha's avatarDiego Araújo <diegoamc@protonmail.ch>
parent 3e845604
class Content < ApplicationRecord
has_attached_file :video
validates_attachment :video, presence: true,
content_type: /\Avideo\/.*\Z/
end
class AddAttachmentVideoToContents < ActiveRecord::Migration
def self.up
change_table :contents do |t|
t.attachment :video
end
end
def self.down
remove_attachment :contents, :video
end
end
......@@ -11,24 +11,28 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160615165428) do
ActiveRecord::Schema.define(version: 20160616122150) do
create_table "contents", force: :cascade do |t|
t.string "title", null: false
t.string "title", null: false
t.string "description"
t.integer "user_id", null: false
t.boolean "adult", default: false, null: false
t.integer "user_id", null: false
t.boolean "adult", default: false, null: false
t.integer "rating"
t.string "soundtrack", null: false
t.integer "view_count", default: 0
t.boolean "deleted", default: false, null: false
t.string "soundtrack", null: false
t.integer "view_count", default: 0
t.boolean "deleted", default: false, null: false
t.string "zip_code"
t.string "director", null: false
t.string "director", null: false
t.string "co_director"
t.string "team"
t.boolean "allow_comments", default: true
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "allow_comments", default: true
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "video_file_name"
t.string "video_content_type"
t.integer "video_file_size"
t.datetime "video_updated_at"
end
create_table "profiles", force: :cascade do |t|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment