def notification_keys(options = {})
      subscription_keys    = subscriptions.uniq_keys
      target_notifications = notifications.filtered_by_options(options.select { |k, _| [:filtered_by_key, :custom_filter].include?(k) })
      target_notifications = options[:reverse] ? target_notifications.earliest_order : target_notifications.latest_order
      target_notifications = options[:limit].present? ? target_notifications.limit(options[:limit] + subscription_keys.size) : target_notifications
      notification_keys    = target_notifications.uniq_keys
      notification_keys    =
        case options[:filter]
        when :configured, 'configured'
          notification_keys & subscription_keys
        when :unconfigured, 'unconfigured'
          notification_keys - subscription_keys
        else
          notification_keys
        end
      options[:limit].present? ? notification_keys.take(options[:limit]) : notification_keys
    end
def notification_keys(options = {})
      subscription_keys    = subscriptions.uniq_keys
      target_notifications = notifications.filtered_by_options(options.select { |k, _| [:filtered_by_key, :custom_filter].include?(k) })
      target_notifications = options[:reverse] ? target_notifications.earliest_order : target_notifications.latest_order
      target_notifications = options[:limit].present? ? target_notifications.limit(options[:limit] + subscription_keys.size) : target_notifications
      notification_keys    = target_notifications.uniq_keys
      notification_keys    =
        case options[:filter]
        when :configured, 'configured'
          notification_keys & subscription_keys
        when :unconfigured, 'unconfigured'
          notification_keys - subscription_keys
        else
          notification_keys
        end
      options[:limit].present? ? notification_keys.take(options[:limit]) : notification_keys
    end
Gets received notification keys of the target.

 @example Get unconfigured notification keys of the @user
   @notification_keys = @user.notification_keys(filter: :unconfigured)

 @param [Hash] options Options for unconfigured notification keys
 @option options [Integer]       :limit                  (nil)   Limit to query for subscriptions
 @option options [Boolean]       :reverse                (false) If notification keys will be ordered as earliest first
 @option options [Symbol|String] :filter                 (nil)   Filter option to load notification keys (Nothing as all, 'configured' with configured subscriptions or 'unconfigured' without subscriptions)
 @option options [String]        :filtered_by_key        (nil)   Key of the notification for filter
 @option options [Array|Hash]    :custom_filter          (nil)   Custom subscription filter (e.g. ["created_at >= ?", time.hour.ago])
 @return [Array<Notificaion>] Unconfigured notification keys of the target