Sha256: 4f080376401c5316100ef390a3c20e8cee02f55d204ebd5d0a3d9e566cb0205b

Contents?: true

Size: 535 Bytes

Versions: 14

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  class PageSerializer < ActiveModel::Serializer
    self.root = false

    attributes :id,
      :name,
      :urlname,
      :page_layout,
      :title,
      :language_code,
      :meta_keywords,
      :meta_description,
      :tag_list,
      :created_at,
      :updated_at,
      :status

    has_many :elements, :cells

    def elements
      if object.has_cells?
        object.elements.not_in_cell.published
      else
        object.elements.published
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.1.2 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.1.1 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.1.0 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.0.5 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.0.4 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.1.0.rc1 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.0.3 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.0.2 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.1.0.beta app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.0.1 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.0.0 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.0.0.rc2 app/serializers/alchemy/page_serializer.rb
alchemy_cms-4.0.0.rc1 app/serializers/alchemy/page_serializer.rb