require_dependency "phcmemberspro/application_controller" module Phcmemberspro class Dashboard::MainsController < ApplicationController # Security & Action Filters before_action :require_user # Dashboard Index def index @members_main = Phcmemberspro::Members::Main.where(oganization_id: membership_info.org_id) @members_business = Phcmemberspro::Members::Business.where(oganization_id: membership_info.org_id) @members_contact = Phcmemberspro::Members::Contact.where(oganization_id: membership_info.org_id) @directory_category = Phcmemberspro::Directory::Category.where(oganization_id: membership_info.org_id) @directory_catlists = Phcmemberspro::Directory::Catlist.where(oganization_id: membership_info.org_id) end private # Grab User Session Key (For ID) def current_user @_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user) end # Get Current User from Above and Get Membership Info def membership_info AuthRocket::Membership.all(user_id: current_user.id).first end end end