mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix build.
This commit is contained in:
parent
3bc8b6c2f0
commit
b18439a1e2
@ -344,7 +344,7 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def read_first_notification?
|
def read_first_notification?
|
||||||
notifications.order(created_at: :asc).first.read
|
notifications.order(created_at: :asc).first&.read || false
|
||||||
end
|
end
|
||||||
|
|
||||||
def publish_notifications_state
|
def publish_notifications_state
|
||||||
|
@ -1336,5 +1336,11 @@ describe User do
|
|||||||
expect(user.read_first_notification?).to eq(true)
|
expect(user.read_first_notification?).to eq(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'when user does not have any notifications' do
|
||||||
|
it 'should return the right value' do
|
||||||
|
expect(user.read_first_notification?).to eq(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user