Class: Org

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActionView::Helpers::AutoTagHelper::FormInfo, ActiveRecord::Mlang
Defined in:
app/models/org.rb

Instance Method Summary collapse

Instance Method Details

#representativeObject



20
21
22
23
# File 'app/models/org.rb', line 20

def representative
  tname = OrgDirectorType.table_name
  self.directors.joins(:org_director_type).where("#{tname}.position" => OrgDirectorType.where(org_id: self.id).minimum(:position)).order(id: :asc).uniq.first
end