Class: OnsiteNotification

Inherits:
ApplicationRecord show all
Defined in:
app/models/onsite_notification.rb

Class Method Summary collapse

Methods inherited from ApplicationRecord

descendants_using_encryption, lockbox_options, #timestamp_attributes_for_update_in_model, #valid?

Class Method Details

.for_user(user, include_dismissed: false) ⇒ Object



7
8
9
10
11
12
# File 'app/models/onsite_notification.rb', line 7

def self.for_user(user, include_dismissed: false)
  notifications = where(va_profile_id: user.vet360_id).order(created_at: :desc)
  return notifications if include_dismissed

  notifications.where(dismissed: false)
end