Sha256: 4e6584ea8d5864e4d2bdfd07df60e981d614a18932c0c6861ad708a26c702b34

Contents?: true

Size: 923 Bytes

Versions: 32

Compression:

Stored size: 923 Bytes

Contents

module ActivityNotification
  # Notification group implementation included in group model to bundle notification.
  module Group
    extend ActiveSupport::Concern
    included do
      include Common
      class_attribute :_printable_notification_group_name
      set_group_class_defaults
    end

    class_methods do
      # Checks if the model includes notification group methods are available.
      # @return [Boolean] Always true
      def available_as_group?
        true
      end

      # Sets default values to group class fields.
      # @return [NilClass] nil
      def set_group_class_defaults
        self._printable_notification_group_name = :printable_name
        nil
      end
    end

    # Returns printable group model name to show in view or email.
    # @return [String] Printable group model name
    def printable_group_name
      resolve_value(_printable_notification_group_name)
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
activity_notification-2.3.2 lib/activity_notification/models/concerns/group.rb
activity_notification-2.3.1 lib/activity_notification/models/concerns/group.rb
activity_notification-2.3.0 lib/activity_notification/models/concerns/group.rb
activity_notification-2.2.4 lib/activity_notification/models/concerns/group.rb
activity_notification-2.2.3 lib/activity_notification/models/concerns/group.rb
activity_notification-2.2.2 lib/activity_notification/models/concerns/group.rb
activity_notification-2.2.1 lib/activity_notification/models/concerns/group.rb
activity_notification-2.2.0 lib/activity_notification/models/concerns/group.rb
activity_notification-2.1.4 lib/activity_notification/models/concerns/group.rb
activity_notification-2.1.3 lib/activity_notification/models/concerns/group.rb
activity_notification-2.1.2 lib/activity_notification/models/concerns/group.rb
activity_notification-2.1.1 lib/activity_notification/models/concerns/group.rb
activity_notification-2.1.0 lib/activity_notification/models/concerns/group.rb
activity_notification-2.0.0 lib/activity_notification/models/concerns/group.rb
activity_notification-1.7.1 lib/activity_notification/models/concerns/group.rb
activity_notification-1.7.0 lib/activity_notification/models/concerns/group.rb
activity_notification-1.6.1 lib/activity_notification/models/concerns/group.rb
activity_notification-1.6.0 lib/activity_notification/models/concerns/group.rb
activity_notification-1.5.1 lib/activity_notification/models/concerns/group.rb
activity_notification-1.5.0 lib/activity_notification/models/concerns/group.rb