Sha256: 31571cad92565899e1bfcb339b828cdef565b418164a122052a6f53d1923eae8

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
phcmemberspro-7.8.2 app/controllers/phcmemberspro/dashboard/mains_controller.rb