Przeglądaj źródła

debug live broad

abiao 5 lat temu
rodzic
commit
bfea765fe2

+ 1 - 1
app/models/live_broad.rb

@@ -1,7 +1,7 @@
 class LiveBroad < ActiveRecord::Base
     has_paper_trail
     self.table_name = "live_broads"
-    validates :room_id, presence: true
+    validates :room_id,:title, presence: true
     attr_accessor :v_cover
     before_save :before_save
 

+ 1 - 0
config/locales/models/live_broad.yml

@@ -7,6 +7,7 @@ zh-CN:
         title: 直播标题
         room_id: 房间号
         cover: 直播封面
+        v_cover: 直播封面
         begin_time: 开播时间
         end_time: 结束时间
         show: 置顶

+ 2 - 2
db/migrate/20210104114641_create_live_broads.rb

@@ -6,7 +6,7 @@ class CreateLiveBroads < ActiveRecord::Migration
       # 直播标题
       t.column :title, :string,:limit => 128, :null=>false
       #封面
-      t.column :cover, :string,:limit => 256, :null=>false
+      t.column :cover, :string,:limit => 256
       #房间号
       t.column :room_id, :integer,:null=>false, :default => 0
       #开始时间
@@ -16,7 +16,7 @@ class CreateLiveBroads < ActiveRecord::Migration
       # 置顶
       t.column :show, :boolean, :default=>false
       # 备注
-      t.column :remark, :string,:limit => 256, :null=>false
+      t.column :remark, :string,:limit => 256
       t.timestamps
     end
     add_index :live_broads, :room_id