Skip to content

fix(filters): update to flavortowns actual enddate...#1150

Open
Lazylllama wants to merge 2 commits intohackclub:mainfrom
Lazylllama:patch-1
Open

fix(filters): update to flavortowns actual enddate...#1150
Lazylllama wants to merge 2 commits intohackclub:mainfrom
Lazylllama:patch-1

Conversation

@Lazylllama
Copy link
Copy Markdown
Member

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 9, 2026

Greptile Summary

This PR updates the flavortown time-range filter's end date from 2026-03-31 to 2026-04-31, intending to extend the event window through end-of-April. However, April only has 30 days — 2026-04-31 is not a valid date and Time.parse will raise an ArgumentError at runtime, breaking the filter entirely.

  • P0: Time.parse(\"2026-04-31\") raises ArgumentError — change to \"2026-04-30\".

Confidence Score: 4/5

Not safe to merge — the invalid date will raise ArgumentError at runtime whenever the Flavortown filter is used.

A single P0 bug is present: April 31 is not a valid date and Time.parse will raise ArgumentError, breaking the Flavortown filter entirely. The fix is a trivial one-character change (31 → 30).

app/models/concerns/time_range_filterable.rb — line 43 has the invalid date.

Vulnerabilities

No security concerns identified.

Important Files Changed

Filename Overview
app/models/concerns/time_range_filterable.rb Updates Flavortown end date from 2026-03-31 to 2026-04-31, but April has only 30 days — Time.parse will raise ArgumentError at runtime.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[filter_by_time_range called with flavortown] --> B[calculate lambda invoked]
    B --> C["Time.parse date string"]
    C -->|Invalid: April has 30 days| D[ArgumentError raised]
    C -->|Fix: use 2026-04-30| E[Valid date range returned]
    E --> F[where scope applied correctly]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: app/models/concerns/time_range_filterable.rb
Line: 43

Comment:
**Invalid date: April has only 30 days**

`Time.parse("2026-04-31")` will raise an `ArgumentError` at runtime because April 31 does not exist. This will crash every call to the `flavortown` scope and the `filter_by_time_range` helper whenever `:flavortown` is selected. The end date should be `2026-04-30`.

```suggestion
          to = Time.parse("2026-04-30").end_of_day
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(filters): update to flavortowns actu..." | Re-trigger Greptile

april 31st doesnt exist,

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant