Module: OfficersHelper

Defined in:
app/helpers/officers_helper.rb

Instance Method Summary collapse

Instance Method Details

#sort_officer_groups(officer_groups) ⇒ Object



7
8
9
10
11
# File 'app/helpers/officers_helper.rb', line 7

def sort_officer_groups(officer_groups)
  officer_groups.sort_by do |group|
    [:main_admins, :admins].index(group.flags.first.try(:to_sym)) || (100 + group.id)
  end
end

#sorted_officers_groups_for(structureable) ⇒ Object



3
4
5
# File 'app/helpers/officers_helper.rb', line 3

def sorted_officers_groups_for(structureable)
  sort_officer_groups(structureable.find_officers_groups)
end