Removed duplicate methods date_range_string and date_string.
Added tests for date_string function corrections in the test
This commit is contained in:
parent
3bf8b2472d
commit
ec1adbada8
5 changed files with 56 additions and 56 deletions
|
|
@ -1,4 +1,5 @@
|
|||
class ConferenceSerializer < ActiveModel::Serializer
|
||||
include ApplicationHelper
|
||||
attributes :short_title, :title, :description, :start_date, :end_date, :picture_url,
|
||||
:difficulty_levels, :event_types, :rooms, :tracks,
|
||||
:date_range, :revision
|
||||
|
|
@ -58,8 +59,8 @@ class ConferenceSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def date_range
|
||||
if defined? object.date_range_string
|
||||
object.date_range_string.try(:split, ',').try(:first)
|
||||
if defined? date_string(object.start_date, object.end_date)
|
||||
date_string(object.start_date, object.end_date).try(:split, ',').try(:first)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue