app/commands/decidim/proposals/admin/import_proposals.rb in decidim-proposals-0.26.10 vs app/commands/decidim/proposals/admin/import_proposals.rb in decidim-proposals-0.27.0.rc1
- old
+ new
@@ -3,11 +3,11 @@
module Decidim
module Proposals
module Admin
# A command with all the business logic when an admin imports proposals from
# one component to another.
- class ImportProposals < Rectify::Command
+ class ImportProposals < Decidim::Command
# Public: Initializes the command.
#
# form - A form object with the params.
def initialize(form)
@form = form
@@ -74,13 +74,10 @@
def target_component
@form.current_component
end
def proposal_already_copied?(original_proposal, target_component)
- # Note: we are including also proposals from unpublished components
- # because otherwise duplicates could be created until the component is
- # published.
- original_proposal.linked_resources(:proposals, "copied_from_component", component_published: false).any? do |proposal|
+ original_proposal.linked_resources(:proposals, "copied_from_component").any? do |proposal|
proposal.component == target_component
end
end
def proposal_author