Sha256: 6cca0bb3daab911c690ef98930f114877cf9407d7d8203f6c0b40de9c528dbda

Contents?: true

Size: 487 Bytes

Versions: 3

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

module NotificationHandler
  module NotificationScopes
    extend ActiveSupport::Concern

    included do
      scope :read, -> { where(read: true) }
      scope :unread, -> { where(read: false) }

      if defined?(NotificationRenderer)
        include NotificationRenderer::NotificationScopes
      end
      if defined?(NotificationSettings)
        include NotificationSettings::NotificationScopes
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
notification-handler-3.0.2 lib/notification_handler/notification_scopes.rb
notification-handler-2.0.0 lib/notification_handler/notification_scopes.rb
notification-handler-1.2.6 lib/notification_handler/notification_scopes.rb