Class: PageSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/page_serializer.rb

Instance Method Summary collapse

Instance Method Details

#imageObject


14
15
16
# File 'app/serializers/page_serializer.rb', line 14

def image
  object.page_images.where(primary: true).try(:first)
end

#imagesObject


18
19
20
# File 'app/serializers/page_serializer.rb', line 18

def images
  object.page_images
end

#paramObject


10
11
12
# File 'app/serializers/page_serializer.rb', line 10

def param
  object.to_param
end