mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
Use an infinite sequence and save a query
This commit is contained in:
parent
90dd0f7cdc
commit
c9f71ce328
1 changed files with 1 additions and 1 deletions
|
@ -296,7 +296,7 @@ class Agent < ActiveRecord::Base
|
|||
new(original.slice(:type, :options, :service_id, :schedule, :controller_ids, :control_target_ids,
|
||||
:source_ids, :keep_events_for, :propagate_immediately, :scenario_ids)) { |clone|
|
||||
# Give it a unique name
|
||||
2.upto(count) do |i|
|
||||
2.step do |i|
|
||||
name = '%s (%d)' % [original.name, i]
|
||||
unless exists?(name: name)
|
||||
clone.name = name
|
||||
|
|
Loading…
Add table
Reference in a new issue