Module: EventPresenter::ClassMethods

Defined in:
app/presenters/event_presenter.rb

Instance Method Summary collapse

Instance Method Details

#options_for_select_by_organization(organization) ⇒ Object

Presents events for a select tag in the views



4
5
6
7
8
# File 'app/presenters/event_presenter.rb', line 4

def options_for_select_by_organization(organization)
  where(organization_id: organization.id).collect do |event|
    [event.name, event.id]
  end.sort{|a, b| a[0] <=> b[0]} #.unshift([Event::ANY_EVENT_TEXT, Event::ANY_EVENT_ID])
end