Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
Project is not mandatory to have any builds being run yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
minuscorp committed Apr 17, 2018
1 parent c74bd97 commit 2746a18
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/features-json/view_models/project_summary_view_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ class ProjectSummaryViewModel
# @return [DateTime] Start time
attr_reader :latest_timestamp

def initialize(project:, latest_build:)
def initialize(project:, latest_build: nil)
raise "Incorrect object type. Expected Project, got #{project.class}" unless project.kind_of?(Project)
raise "Incorrect object type. Expected Build, got #{latest_build.class}" unless latest_build.kind_of?(Build)
unless latest_build.nil?
raise "Incorrect object type. Expected Build, got #{latest_build.class}" unless latest_build.kind_of?(Build)
end

@name = project.project_name
@lane = project.lane
@id = project.id
@latest_status = latest_build.status
@latest_timestamp = latest_build.timestamp
@latest_status = latest_build&.status
@latest_timestamp = latest_build&.timestamp
end
end
end

0 comments on commit 2746a18

Please sign in to comment.