Browse Source

直播增加级别限制

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

+ 4 - 3
app/models/live_broad.rb

@@ -5,6 +5,7 @@ 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 before_save
@@ -82,12 +83,12 @@ class LiveBroad < ActiveRecord::Base
           field :depart_record
           field :show
           field :recommend
-
           field :rank_str do
-            pretty_value do
-              bindings[:view].tag(:checkbox, {:value => 1, :class => 'preview'})
+            render do
+              bindings[:form].select( "rank_str", bindings[:object].RANK_ENUM, {}, { :multiple => true })
             end
           end
+
           field :remark
         end
     end