app/helpers/branches_helper.rb
# Returns a hash were keys are types of access levels (user, role), and
# values are the number of access levels of the particular type.
Returns a hash were keys are types of access levels (user, role), and
values are the number of access levels of the particular type.
Returns a hash were keys are types of access levels ( user role ) and values are the number of access levels of the particular type .
def access_level_frequencies(access_levels)
    access_levels.reduce(Hash.new(0)) do |frequencies, access_level|
      frequencies[access_level.type] += 1
      frequencies
    end
  end
def access_level_frequencies ( access_levels ) access_levels . reduce ( Hash . new ( 0 ) ) do | frequencies , access_level | frequencies [ access_level . type ] += 1 frequencies end end
Returns a hash were keys are types of access levels (user, role), and
values are the number of access levels of the particular type.
Returns a hash were keys are types of access levels ( user role ) and values are the number of access levels of the particular type .
access_levels