Skip to content

Commit bb97997

Browse files
committed
Fix for new accounts with last_seen_on NULL
1 parent ad946fc commit bb97997

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def seo_filter
4747

4848
def set_account_last_seen
4949
# Update last seen only once a day to avoid too many database update
50-
if Date.today - current_account.last_seen_on >= 1
50+
if current_account.last_seen_on.nil? || Date.today - current_account.last_seen_on >= 1
5151
# Use update_columns to ensure updated_at value is not changed with this
5252
# automatic update
5353
current_account.update_columns(last_seen_on: Date.today);

0 commit comments

Comments
 (0)