Browse Source

直播增加级别限制

abiao 4 years ago
parent
commit
e8e3989593
1 changed files with 4 additions and 4 deletions
  1. 4 4
      app/models/live_broad.rb

+ 4 - 4
app/models/live_broad.rb

@@ -5,7 +5,6 @@ class LiveBroad < ActiveRecord::Base
     attr_accessor :v_cover
     before_save :before_save
     has_and_belongs_to_many :depart_record
-    serialize :rank_str, Array
     RANK_ENUM= [["普通会员","0"], ["群主","1"], ["店长", "2"], ["区域代理", "3"]]
     def roles_enum
       [ [ 'role one', 1 ], [ 'role 2', 2 ], [ 'role 3', 3 ] ]
@@ -85,9 +84,10 @@ class LiveBroad < ActiveRecord::Base
           field :depart_record
           field :show
           field :recommend
-          field :rank_str do
-            render do
-              bindings[:form].select(roles_enum, {}, { :multiple => true })
+          field :rank_str , :enum do
+            enum do
+              RANK_ENUM
+              { :multiple => true }
             end
           end