Skip to content

Commit 43f065f

Browse files
authored
Use Time.current in event scopes (#1021)
## Summary - use `Time.current` for comparing event times ## Testing - `bundle exec rubocop` *(fails: bundler: command not found: rubocop)* - `bundle exec brakeman -q -w2` *(fails: bundler: command not found: brakeman)* - `bundle exec bundler-audit --update` *(fails: bundler: command not found: bundler-audit)* - `bin/codex_style_guard` *(fails: bundler: command not found: rubocop)* - `bin/ci` *(fails: bundler: command not found: rails)* ------ https://chatgpt.com/codex/tasks/task_e_689b7c1631288321a53271dcc47dac9a
2 parents 1e32636 + dfcc60c commit 43f065f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/models/better_together/event.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class Event < ApplicationRecord
3636
}
3737

3838
scope :upcoming, lambda {
39-
start_query = arel_table[:starts_at].gteq(DateTime.now)
39+
start_query = arel_table[:starts_at].gteq(Time.current)
4040
where(start_query)
4141
}
4242

4343
scope :past, lambda {
44-
start_query = arel_table[:starts_at].lt(DateTime.now)
44+
start_query = arel_table[:starts_at].lt(Time.current)
4545
where(start_query)
4646
}
4747

0 commit comments

Comments
 (0)