Adds User#for_render
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
class Admin::OfficialsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@officials = User.officials.page(params[:page])
|
||||
@officials = User.officials.page(params[:page]).for_render
|
||||
end
|
||||
|
||||
def search
|
||||
@users = User.with_email(params[:email]).page(params[:page])
|
||||
@users = User.with_email(params[:email]).page(params[:page]).for_render
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
@@ -25,11 +25,11 @@ class User < ActiveRecord::Base
|
||||
|
||||
accepts_nested_attributes_for :organization
|
||||
|
||||
default_scope { includes(:organization) }
|
||||
scope :administrators, -> { joins(:administrators) }
|
||||
scope :moderators, -> { joins(:moderator) }
|
||||
scope :organizations, -> { joins(:organization) }
|
||||
scope :officials, -> { where("official_level > 0") }
|
||||
scope :for_render, -> { includes(:organization) }
|
||||
|
||||
def self.find_for_oauth(auth, signed_in_resource = nil)
|
||||
# Get the identity and user if they exist
|
||||
|
||||
Reference in New Issue
Block a user