Sha256: 6ffd56156163a6d664a5dce95bc5bf837f9eb108be42615c18b3b47cb20842bf

Contents?: true

Size: 502 Bytes

Versions: 4

Compression:

Stored size: 502 Bytes

Contents

module IamHelper
  ROLE_CLASS = Iam::Configuration.role_class.constantize
  ACCOUNT_CLASS = Iam::Configuration.account_class.constantize

  def iam
    @account_samples = account_samples
    render 'iam/menu'
  end

  private
  def account_samples
    ROLE_CLASS.all.inject({}) do |account_groups, role|
      account_group = ACCOUNT_CLASS.where(ROLE_CLASS.to_s.foreign_key => role.id).limit(Iam::Configuration.accounts_for_each_role)
      account_groups.merge role => account_group
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iam-0.0.8 app/helpers/iam_helper.rb
iam-0.0.7 app/helpers/iam_helper.rb
iam-0.0.6 app/helpers/iam_helper.rb
iam-0.0.5 app/helpers/iam_helper.rb