mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
Inherit receivers when cloning
This commit is contained in:
parent
3ffe667f9e
commit
ef82bfabb7
2 changed files with 2 additions and 2 deletions
|
@ -294,7 +294,7 @@ class Agent < ActiveRecord::Base
|
|||
class << self
|
||||
def build_clone(original)
|
||||
new(original.slice(:type, :options, :service_id, :schedule, :controller_ids, :control_target_ids,
|
||||
:source_ids, :keep_events_for, :propagate_immediately, :scenario_ids)) { |clone|
|
||||
:source_ids, :receiver_ids, :keep_events_for, :propagate_immediately, :scenario_ids)) { |clone|
|
||||
# Give it a unique name
|
||||
2.step do |i|
|
||||
name = '%s (%d)' % [original.name, i]
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<div class="event-related-region">
|
||||
<% eventTargets = (current_user.agents - [@agent]).find_all { |a| a.can_receive_events? } %>
|
||||
<%= f.select(:receiver_ids,
|
||||
options_for_select(eventTargets.map {|s| [s.name, s.id] },
|
||||
options_for_select(eventTargets.pluck(:name, :id),
|
||||
@agent.receiver_ids),
|
||||
{}, { :multiple => true, :size => 5, :class => 'select2-linked-tags form-control', data: {url_prefix: '/agents'} }) %>
|
||||
<span class='cannot-create-events text-info'>This type of Agent cannot create events.</span>
|
||||
|
|
Loading…
Add table
Reference in a new issue