podemos-info/participa2

View on GitHub
decidim-module-crowdfundings/app/commands/decidim/crowdfundings/admin/campaign_command.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Decidim
  module Crowdfundings
    module Admin
      # This command contains all common methods for all campaign related
      # commands
      class CampaignCommand < Rectify::Command
        attr_reader :form

        def initialize(form)
          @form = form
        end

        protected

        def amounts
          form.amounts.split(",").map(&:to_i).uniq.sort { |a, b| a - b }
        end
      end
    end
  end
end