Sha256: 2dbb0cf9d2cbc4a5d25c8ac0b8b34e06be3497c70883397eb1bbe03cbc89d2ec

Contents?: true

Size: 765 Bytes

Versions: 7

Compression:

Stored size: 765 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Elections
    module Trustees
      class NotifyNewTrusteeEvent < Decidim::Events::SimpleEvent
        # This event sends a notification when a new trustee gets created.

        delegate :organization, to: :user, prefix: false
        delegate :url_helpers, to: "Decidim::Core::Engine.routes"

        i18n_attributes :resource_name, :trustee_zone_url

        def resource_name
          @resource_name ||= translated_attribute(participatory_space.title)
        end

        def participatory_space
          @participatory_space ||= resource
        end

        def trustee_zone_url
          url_helpers.decidim_elections_trustee_zone_url(host: organization.host)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/events/decidim/elections/trustees/notify_new_trustee_event.rb
decidim-elections-0.28.3 app/events/decidim/elections/trustees/notify_new_trustee_event.rb
decidim-elections-0.28.2 app/events/decidim/elections/trustees/notify_new_trustee_event.rb
decidim-elections-0.28.1 app/events/decidim/elections/trustees/notify_new_trustee_event.rb
decidim-elections-0.28.0 app/events/decidim/elections/trustees/notify_new_trustee_event.rb
decidim-elections-0.28.0.rc5 app/events/decidim/elections/trustees/notify_new_trustee_event.rb
decidim-elections-0.28.0.rc4 app/events/decidim/elections/trustees/notify_new_trustee_event.rb