Method: ActivityNotification::ORM::ActiveRecord::Notification.earlier_than

Defined in:
lib/activity_notification/orm/active_record/notification.rb

.earlier_thanActiveRecord_AssociationRelation<Notificaion>, Mongoid::Criteria<Notificaion>

Selects filtered notifications earlier than specified time.

Examples:

Get filtered unopened notificatons of the @user earlier than @notification

@notifications = @user.notifications.unopened_only.earlier_than(@notification.created_at)

Parameters:

  • Created (Time)

    time of the notifications for filter

Returns:

  • (ActiveRecord_AssociationRelation<Notificaion>, Mongoid::Criteria<Notificaion>)

    Database query of filtered notifications



149
# File 'lib/activity_notification/orm/active_record/notification.rb', line 149

scope :earlier_than,                      ->(created_time) { where('created_at < ?', created_time) }