Skip to content

Add started_at/ended_at datetime fields to Banner#1342

Open
diti0-dot wants to merge 1 commit intorubyforgood:mainfrom
diti0-dot:banner
Open

Add started_at/ended_at datetime fields to Banner#1342
diti0-dot wants to merge 1 commit intorubyforgood:mainfrom
diti0-dot:banner

Conversation

@diti0-dot
Copy link
Copy Markdown
Collaborator

Closes #216

What is the goal of this PR and why is this important?

Adds support for scheduled banners with start/end dates

How did you approach the change?

Added started_at/ended_at datetime fields to Banner, created an :active scope to filter by current date, and updated display_banner helper to show all active banners instead of just the last one.

UI Testing Checklist

Anything else to add?

Should I also add the started_at and ended_at fields to the banners/new form?

@maebeale
Copy link
Copy Markdown
Collaborator

@diti0-dot would you rebase main into this branch, re-run tests locally and push updates so conflicts are removed and it can pass ci?

@maebeale
Copy link
Copy Markdown
Collaborator

maebeale commented Apr 5, 2026

Closing in favor of a new PR from origin — the fork's branch had unresolvable stale merge refs.

@maebeale
Copy link
Copy Markdown
Collaborator

maebeale commented Apr 5, 2026

Hey @diti0-dot! CI is failing because db/schema.rb on your fork's banner branch has merge conflict markers (the <<<<<<<, =======, >>>>>>> lines) that were committed during a previous rebase. Since the PR comes from your fork, we can't push fixes directly.

Here's how to fix it from your local clone:

# 1. Make sure you're on the banner branch
git checkout banner

# 2. Fetch the latest upstream main
git fetch upstream main

# 3. Reset your branch to upstream main
git reset --hard upstream/main

# 4. Cherry-pick the clean commit we prepared (from the origin repo)
git cherry-pick c6042ed28

# 5. Force push to your fork
git push origin banner --force

If you don't have upstream set up yet:

git remote add upstream https://github.com/rubyforgood/awbw.git

The key issue is that db/schema.rb had conflict markers from a rebase that weren't fully resolved. The cherry-pick above has a clean version with only the banner started_at/ended_at changes.

Add scheduled banner support with start/end dates. Created an :active
scope to filter by current date, and updated display_banner helper
to show all active banners instead of just the last one.

Closes rubyforgood#216
@diti0-dot
Copy link
Copy Markdown
Collaborator Author

@maebeale Thanks for guiding me through this 🫶. I really appreciate the help. Please let me know if anything else needs to be updated!

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.

Support scheduled Banners

2 participants