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-0.6.0 decidim-core/app/models/decidim/notification.rb