Module: IamHelper

Included in:
IamController
Defined in:
app/helpers/iam_helper.rb

Instance Method Summary collapse

Instance Method Details

#account_samplesObject



16
17
18
19
20
21
22
23
24
# File 'app/helpers/iam_helper.rb', line 16

def 
  role_class = Iam::Configuration[:role][:class].constantize
   = Iam::Configuration[:account][:class].constantize

  role_class.all.inject({}) do |, role|
     = .where(role_class.to_s.foreign_key => role.id).order(:id).limit(Iam::Configuration[:accounts_for_each_role])
    .merge role => 
  end
end

#extract_attributes(instance, type) ⇒ Object



10
11
12
13
14
# File 'app/helpers/iam_helper.rb', line 10

def extract_attributes(instance, type)
  Iam::Configuration[type][:attributes].map do |attribute|
    instance.public_send attribute
  end
end