New associations and models: schedule versioning

For the schedule versioning in the admin interface (having multiple possible shcedules) we need to change some models and associations. It has also been create a rake:move_events_attributes task to migrate the data.

User Interface addapted to make use of the introduced associations and models
This commit is contained in:
Ana 2016-07-08 13:28:02 +02:00
parent e34a1904e0
commit c047ffd699
21 changed files with 165 additions and 49 deletions

View file

@ -1,11 +1,11 @@
class EventSerializer < ActiveModel::Serializer
include ActionView::Helpers::TextHelper
attributes :guid, :title, :length, :date, :language, :abstract, :speaker_ids, :type, :room, :track
attributes :guid, :title, :length, :scheduled_date, :language, :abstract, :speaker_ids, :type, :scheduled_room, :track
def date
t = object.start_time
t.blank? ? '' : %{ #{I18n.l t, format: :short}#{t.formatted_offset(false)} }
def scheduled_date
t = object.scheduled_start_time
t.blank? ? '' : %( #{I18n.l t, format: :short}#{t.formatted_offset(false)} )
end
def speaker_ids
@ -17,8 +17,8 @@ class EventSerializer < ActiveModel::Serializer
object.event_type.try(:title)
end
def room
object.room.try(:guid)
def scheduled_room
object.scheduled_room.try(:guid)
end
def track