Class: Deployments::App::Commit

Inherits:
Object
  • Object
show all
Includes:
DataMapper::Resource
Defined in:
lib/deployments-app/models/commit.rb

Class Method Summary collapse

Class Method Details

.find_by_sha_or_create(commit) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/deployments-app/models/commit.rb', line 19

def self.find_by_sha_or_create(commit)
  existing = first(:sha => commit[:sha])

  return Commit.create(commit) unless existing

  existing
end