From bbf2566352700659a4e7b2b0bc83cd4c06ed09a5 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sun, 6 Mar 2016 14:59:57 +0100 Subject: [PATCH] Use #dup to copy models Since we require ActiveRecord >= 3.2, #dup should be used, not #clone (which is <= 3.1). --- stoptime.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index 5331ffa..a3bdfab 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1306,7 +1306,7 @@ module StopTime::Controllers tasks.each_key do |task| # Create a new (billed) task clone that contains the selected time # entries, leave the rest unbilled and associated with their task. - bill_task = task.dup # FIXME: depends on rails version! + bill_task = task.dup task.time_entries = task.time_entries - tasks[task] task.save bill_task.time_entries = tasks[task] @@ -1729,7 +1729,7 @@ module StopTime::Controllers @history_warn = true if @company != CompanyInfo.last if @company == CompanyInfo.last and @company.invoices.length > 0 old_company = @company - @company = old_company.clone # FIXME: depends on rails version! + @company = old_company.dup @company.original = old_company end