# Resource
actions do
create :create do
primary? true
accept [:subject, :status, :matchers, :frequency]
argument :fetchers, {:array, :uuid}
change manage_relationship(:fetchers, type: :append_and_remove)
end
update :update do
primary? true
accept [:subject, :status, :matchers, :frequency]
argument :fetchers, {:array, :uuid}
change manage_relationship(:fetchers, type: :append_and_remove)
require_atomic? false
end
end
relationships do
many_to_many :fetchers, Scraper.Fetcher,
through: Scraper.TemplateFetcherRelationship,
source_attribute_on_join_resource: :template_id,
destination_attribute_on_join_resource: :fetcher_id
end
# Resource
actions do
create :create do
primary? true
accept [:subject, :status, :matchers, :frequency]
argument :fetchers, {:array, :uuid}
change manage_relationship(:fetchers, type: :append_and_remove)
end
update :update do
primary? true
accept [:subject, :status, :matchers, :frequency]
argument :fetchers, {:array, :uuid}
change manage_relationship(:fetchers, type: :append_and_remove)
require_atomic? false
end
end
relationships do
many_to_many :fetchers, Scraper.Fetcher,
through: Scraper.TemplateFetcherRelationship,
source_attribute_on_join_resource: :template_id,
destination_attribute_on_join_resource: :fetcher_id
end