Sha256: ad63ba019b3426f525cf4a2c37691096cbca82eb20aadc83f59334d5a183af8c

Contents?: true

Size: 466 Bytes

Versions: 41

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class Notification < ApplicationRecord
    belongs_to :resource, foreign_key: "decidim_resource_id", foreign_type: "decidim_resource_type", polymorphic: true
    belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"

    def event_class_instance
      @event_class_instance ||= event_class.constantize.new(resource: resource, event_name: event_name, user: user, extra: extra)
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
decidim-core-0.12.2 app/models/decidim/notification.rb
decidim-core-0.12.1 app/models/decidim/notification.rb
decidim-core-0.12.0 app/models/decidim/notification.rb
decidim-core-0.11.2 app/models/decidim/notification.rb
decidim-core-0.12.0.pre app/models/decidim/notification.rb
decidim-core-0.11.1 app/models/decidim/notification.rb
decidim-core-0.11.0.pre1 app/models/decidim/notification.rb
decidim-core-0.10.1 app/models/decidim/notification.rb
decidim-core-0.10.0 app/models/decidim/notification.rb
decidim-core-0.9.3 app/models/decidim/notification.rb
decidim-core-0.9.2 app/models/decidim/notification.rb
decidim-core-0.9.1 app/models/decidim/notification.rb
decidim-core-0.9.0 app/models/decidim/notification.rb
decidim-core-0.8.4 app/models/decidim/notification.rb
decidim-core-0.8.3 app/models/decidim/notification.rb
decidim-core-0.8.2 app/models/decidim/notification.rb
decidim-core-0.8.1 app/models/decidim/notification.rb
decidim-core-0.8.0 app/models/decidim/notification.rb
decidim-core-0.7.4 app/models/decidim/notification.rb
decidim-core-0.7.3 app/models/decidim/notification.rb