Sha256: 6f6052086181935f7e5b7a7e9b4128933e3895da11d257f91fe6d8949c79cfe6

Contents?: true

Size: 797 Bytes

Versions: 3

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module DecidimAwesome
    module Proposals
      ##
      # Decorates update draft and update proposal
      # to avoid private field to be logged in PaperTrail.
      module UpdateCollaborativeDraftOverride
        extend ActiveSupport::Concern

        included do
          private

          alias_method :decidim_original_update_collaborative_draft, :update_collaborative_draft

          def update_collaborative_draft
            decidim_original_update_collaborative_draft
            # Update the proposal with the private body, to
            # avoid tracebility on private fields.
            @collaborative_draft.update_private_body!(form.private_body) if form.private_body.present?
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.10.3 app/commands/concerns/decidim/decidim_awesome/proposals/update_collaborative_draft_override.rb
decidim-decidim_awesome-0.11.2 app/commands/concerns/decidim/decidim_awesome/proposals/update_collaborative_draft_override.rb
decidim-decidim_awesome-0.11.1 app/commands/concerns/decidim/decidim_awesome/proposals/update_collaborative_draft_override.rb