Event model improvements
- Drop selected_event_schedule function - Rename scheduled_room and scheduled_start_time to room and time as if there is no selected_schedule, the event is not scheduled.
This commit is contained in:
parent
5001848af7
commit
a578167cf5
13 changed files with 32 additions and 35 deletions
|
|
@ -1,10 +1,10 @@
|
|||
class EventSerializer < ActiveModel::Serializer
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
attributes :guid, :title, :length, :scheduled_date, :language, :abstract, :speaker_ids, :type, :scheduled_room, :track
|
||||
attributes :guid, :title, :length, :scheduled_date, :language, :abstract, :speaker_ids, :type, :room, :track
|
||||
|
||||
def scheduled_date
|
||||
t = object.scheduled_start_time
|
||||
t = object.time
|
||||
t.blank? ? '' : %( #{I18n.l t, format: :short}#{t.formatted_offset(false)} )
|
||||
end
|
||||
|
||||
|
|
@ -17,8 +17,8 @@ class EventSerializer < ActiveModel::Serializer
|
|||
object.event_type.try(:title)
|
||||
end
|
||||
|
||||
def scheduled_room
|
||||
object.scheduled_room.try(:guid)
|
||||
def room
|
||||
object.room.try(:guid)
|
||||
end
|
||||
|
||||
def track
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue