can display scope

This commit is contained in:
Matthew K. Fu JuYuan 2012-08-15 11:34:19 +08:00
parent 905844f7bb
commit d9f6bb3b4e
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ class Bulletin
field :public, :type => Boolean, :default => true
scope :can_display,where(is_checked: true)
scope :can_display,all_of(is_checked: true,is_rejected: false,is_pending: false)
scope :available_for_lang, ->(locale){ where("available_for_#{locale}".to_sym => true) }
mount_uploader :image, ImageUploader

View File

@ -43,7 +43,7 @@ class NewsBulletin
field :public, :type => Boolean, :default => true
scope :can_display,where(is_checked: true)
scope :can_display,all_of(is_checked: true,is_rejected: false,is_pending: false)
scope :available_for_lang, ->(locale){ where("available_for_#{locale}".to_sym => true) }
mount_uploader :image, ImageUploader