houndci fixes
This commit is contained in:
parent
23bf55b66c
commit
9292b79c78
13 changed files with 151 additions and 144 deletions
|
|
@ -20,16 +20,16 @@ class ConferenceSerializer < ActiveModel::Serializer
|
|||
# FIXME: adjusting the format the DIRTY way, for oSC13.
|
||||
# If you think this is ugly, don't look at the methods below
|
||||
def date_range
|
||||
object.date_range_string.try(:split, ",").try(:first)
|
||||
object.date_range_string.try(:split, ',').try(:first)
|
||||
end
|
||||
|
||||
# FIXME: just giving suseconferenceclient something to play with
|
||||
def description
|
||||
"openSUSE Conference 2013 - Power to the Geeko"
|
||||
'openSUSE Conference 2013 - Power to the Geeko'
|
||||
end
|
||||
|
||||
# FIXME: same than the former
|
||||
def url
|
||||
"https://conference.opensuse.org/"
|
||||
'https://conference.opensuse.org/'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
# Needed in order to add the API version number to the conferences array
|
||||
#
|
||||
class ConferencesArraySerializer < ActiveModel::ArraySerializer
|
||||
|
||||
def as_json(*args)
|
||||
json = super
|
||||
json.merge!(:version => 1)
|
||||
json.merge!(version: 1)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
class EventSerializer < ActiveModel::Serializer
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
attributes :guid, :title, :length, :date, :language, :abstract,
|
||||
:speaker_ids, :type, :room, :track
|
||||
attributes :guid, :title, :length, :date, :language, :abstract, :speaker_ids, :type, :room, :track
|
||||
|
||||
def date
|
||||
t = object.start_time
|
||||
t.blank? ? "" : %(#{t.time.strftime("%Y-%m-%dT%H:%M:%S")}#{t.formatted_offset(false)})
|
||||
t.blank? ? '' : %(#{t.time.strftime('%Y-%m-%dT%H:%M:%S')}#{t.formatted_offset(false)})
|
||||
end
|
||||
|
||||
def speaker_ids
|
||||
speakers = object.event_users.select {|i| i.event_role == "speaker" }
|
||||
speakers.map {|i| i.user.id}
|
||||
speakers = object.event_users.select { |i| i.event_role == 'speaker' }
|
||||
speakers.map { |i| i.user.id }
|
||||
end
|
||||
|
||||
def type
|
||||
|
|
@ -31,7 +30,7 @@ class EventSerializer < ActiveModel::Serializer
|
|||
if object.abstract.blank?
|
||||
nil
|
||||
else
|
||||
simple_format(object.abstract).gsub("\n", "")
|
||||
simple_format(object.abstract).gsub('\n', '')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ class RoomSerializer < ActiveModel::Serializer
|
|||
|
||||
# FIXME: just giving suseconferenceclient something to play with
|
||||
def description
|
||||
""
|
||||
''
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class SpeakerSerializer < ActiveModel::Serializer
|
|||
if object.biography.blank?
|
||||
nil
|
||||
else
|
||||
simple_format(object.biography).gsub("\n", "")
|
||||
simple_format(object.biography).gsub('\n', '')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue