can display scope

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

No files matched your search

@@ -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
+1 -1
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