diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2016-11-16 14:46:07 +0300 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2016-11-16 14:46:07 +0300 |
commit | ef3be00a0297dfa31002616df6ee49a0e2132cb7 (patch) | |
tree | 2316894b87a84db4ecb8ddcd96eba046aeb2a47b /app/models/service.rb | |
parent | 0f48abf24b0ba34aebfc1d0d52e9e22648b7da1a (diff) |
Defer saving project services to the database if there are no user changes
Diffstat (limited to 'app/models/service.rb')
-rw-r--r-- | app/models/service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/service.rb b/app/models/service.rb index 625fbc48302..9d6ff190cdf 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -222,11 +222,11 @@ class Service < ActiveRecord::Base ] end - def self.create_from_template(project_id, template) + def self.build_from_template(project_id, template) service = template.dup service.template = false service.project_id = project_id - service if service.save + service end private |