WIP: first prototype of the JSON API.
* Tests not included, so I cannot prove that it works
This commit is contained in:
parent
83b10447f4
commit
27017a4823
6 changed files with 44 additions and 0 deletions
23
app/serializers/conference_serializer.rb
Normal file
23
app/serializers/conference_serializer.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class ConferenceSerializer < ActiveModel::Serializer
|
||||
attributes :guid, :name, :description, :year, :socialtag, :date_range#, :url, :revision
|
||||
|
||||
def name
|
||||
object.short_title
|
||||
end
|
||||
|
||||
def description
|
||||
object.title
|
||||
end
|
||||
|
||||
def year
|
||||
object.start_date.try(:year)
|
||||
end
|
||||
|
||||
def socialtag
|
||||
object.social_tag
|
||||
end
|
||||
|
||||
def date_range
|
||||
object.date_range_string
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue