Fix scope error
This commit is contained in:
parent
9da9284a7f
commit
5a1545b61d
|
@ -327,7 +327,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
# ================================================================
|
# ================================================================
|
||||||
def get_bulletins_as_json
|
def get_bulletins_as_json
|
||||||
I18n.locale = params[:locale] || :zh_tw
|
I18n.locale = params[:locale] || :zh_tw
|
||||||
bulletins = params[:category_id] ? Bulletin.where(bulletin_category_id: params[:category_id]).order_by(:created_at, :desc) : Bulletin.admin_manager_all.order_by(:created_at, :desc)
|
bulletins = params[:category_id] ? Bulletin.where(bulletin_category_id: params[:category_id]).order_by(:created_at, :desc) : Bulletin.all.order_by(:created_at, :desc)
|
||||||
bulletins = Kaminari.paginate_array(bulletins).page(params[:page]).per(params[:per] || 10) if params[:paginate]
|
bulletins = Kaminari.paginate_array(bulletins).page(params[:page]).per(params[:per] || 10) if params[:paginate]
|
||||||
|
|
||||||
custom_bulletins = bulletins.inject([]) do |data, bulletin|
|
custom_bulletins = bulletins.inject([]) do |data, bulletin|
|
||||||
|
|
Loading…
Reference in New Issue