Module: IamHelper
- Included in:
- IamController
- Defined in:
- app/helpers/iam_helper.rb
Instance Method Summary collapse
Instance Method Details
#account_samples ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/helpers/iam_helper.rb', line 16 def account_samples role_class = Iam::Configuration[:role][:class].constantize account_class = Iam::Configuration[:account][:class].constantize role_class.all.inject({}) do |account_groups, role| account_group = account_class.where(role_class.to_s.foreign_key => role.id).order(:id).limit(Iam::Configuration[:accounts_for_each_role]) account_groups.merge role => account_group 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 |