Sha256: ee794d35bd32f2ddb873e476846c42d1508ec632758ae8fc584ed5b47c516ffd

Contents?: true

Size: 575 Bytes

Versions: 7

Compression:

Stored size: 575 Bytes

Contents

class StackSerializer < ActiveModel::Serializer
  include ConditionalAttributes

  has_one :lock_author
  attributes :id, :repo_owner, :repo_name, :environment, :html_url, :url, :tasks_url,
             :undeployed_commits_count, :is_locked, :lock_reason, :created_at, :updated_at

  def url
    api_stack_url(object)
  end

  def html_url
    stack_url(object)
  end

  def tasks_url
    api_stack_tasks_url(object)
  end

  def is_locked
    object.locked?
  end

  def include_lock_reason?
    object.locked?
  end

  def include_lock_author?
    object.locked?
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shipit-engine-0.4.0 app/serializers/stack_serializer.rb
shipit-engine-0.3.1 app/serializers/stack_serializer.rb
shipit-engine-0.3.0 app/serializers/stack_serializer.rb
shipit-engine-0.2.3 app/serializers/stack_serializer.rb
shipit-engine-0.2.2 app/serializers/stack_serializer.rb
shipit-engine-0.2.1 app/serializers/stack_serializer.rb
shipit-engine-0.2.0 app/serializers/stack_serializer.rb