Class: Event
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Event
- Includes:
- Toggleable
- Defined in:
- app/models/event.rb
Constant Summary collapse
- PER_PAGE =
10
- NAME_LIMIT =
150
- LEAD_LIMIT =
500
- ADDRESS_LIMIT =
250
- DAYS_LIMIT =
(1..99)
Class Method Summary collapse
- .entity_parameters ⇒ Object
- .page_for_administration(page = 1) ⇒ Object
- .page_for_visitors(page = 1) ⇒ Object
Class Method Details
.entity_parameters ⇒ Object
44 45 46 |
# File 'app/models/event.rb', line 44 def self.entity_parameters %i(name slug lead body start_date day_count price address coordinates visible active image) end |
.page_for_administration(page = 1) ⇒ Object
35 36 37 |
# File 'app/models/event.rb', line 35 def self.page_for_administration(page = 1) recent.page(page).per(PER_PAGE) end |
.page_for_visitors(page = 1) ⇒ Object
40 41 42 |
# File 'app/models/event.rb', line 40 def self.page_for_visitors(page = 1) visible.recent.page(page).per(PER_PAGE) end |