Sha256: 96c260996194ae27239ffe7d433add09d6144c8e5621b3801971daecf7148d0d

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

module Perkins
  class BuildReport < ActiveRecord::Base
    belongs_to :repo

    def commit
      self.repo.load_git
      @commit ||= Perkins::Commit.new(self.sha, self.repo)
    end

    def as_json(options = {})
      data = {}

      unless fields = options[:only]
        fields = [:id, :sha, :commit, :branch, :build_time,
                  :status, :duration, :build_time, :response]
      end

      fields.each { |k| data[k] = send(k) }

      data
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
perkins-0.0.2 lib/perkins/build_report.rb