From 296627557efac6a625e7b7aaa86240d5d8759d9a Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 22 Mar 2013 23:14:06 +0400 Subject: [PATCH] #31: small refactoring of #autostart_iso_builds method --- app/models/product.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/product.rb b/app/models/product.rb index f273d9041..765ca8346 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -62,15 +62,14 @@ class Product < ActiveRecord::Base def self.autostart_iso_builds(autostart_status) Product.where(:autostart_status => autostart_status).each do |product| - pbl = product.product_build_lists.new( - :base_url => "http://#{product.platform.default_host}" - ) + pbl = product.product_build_lists.new [:params, :main_script, :project].each do |k| pbl.send "#{k}=", product.send(k) end owner = product.platform.owner pbl.user = owner.is_a?(User) ? owner : owner.owner pbl.autostarted = true + pbl.base_url = "http://#{product.platform.default_host}" pbl.time_living = product.time_living / 60 pbl.project_version = product.project.default_branch pbl.save