Class: Organization

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Includes:
Codeable
Defined in:
app/models/organization.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_for_selectObject

UserIdentity::IDENTITIES.keys.each do |identity|

define_method identity.to_s.pluralize do
end

end


24
25
26
# File 'app/models/organization.rb', line 24

def self.all_for_select
  select(:name, :code).all.map { |u| [u.name, u.code] }
end

.short_name_listObject


28
29
30
# File 'app/models/organization.rb', line 28

def self.short_name_list
  select(:short_name).all.map(&:short_name)
end

Instance Method Details

#department_codesObject


32
33
34
# File 'app/models/organization.rb', line 32

def department_codes
  department_ids
end

#departments_for_selectObject


36
37
38
# File 'app/models/organization.rb', line 36

def departments_for_select
  departments.all.map { |d| [d.name, d.code] }
end