Fixed org_admin administration dashboard error.

Fixed error accessing admin dashboard by passing
organization_id attribute.

Fixes #1933
This commit is contained in:
Rishabh Singh 2018-01-07 16:06:50 +05:30 committed by Ana María Martínez Gómez
parent e1e0bdb4fc
commit 61fcc262c8

View file

@ -595,11 +595,11 @@ class Conference < ApplicationRecord
# * +ActiveRecord+
def self.get_active_conferences_for_dashboard
result = Conference.where('start_date > ?', Time.now)
.select('id, short_title, color, start_date')
.select('id, short_title, color, start_date, organization_id')
if result.empty?
result = Conference
.select('id, short_title, color, start_date').limit(2)
.select('id, short_title, color, start_date, organization_id').limit(2)
.order(start_date: :desc)
end
result
@ -611,7 +611,7 @@ class Conference < ApplicationRecord
# ====Returns
# * +ActiveRecord+
def self.get_conferences_without_active_for_dashboard(active_conferences)
result = Conference.select('id, short_title, color, start_date').order(start_date: :desc)
result = Conference.select('id, short_title, color, start_date, organization_id').order(start_date: :desc)
result - active_conferences
end