Skip to content

Add organization time zone foundation - #7448

Open
KoushikSagarr wants to merge 1 commit into
rubyforgood:mainfrom
KoushikSagarr:7410-time-zone-management
Open

KoushikSagarr wants to merge 1 commit into
rubyforgood:mainfrom
KoushikSagarr:7410-time-zone-management

Conversation

@KoushikSagarr

@KoushikSagarr KoushikSagarr commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What github issue is this PR for, if any?

Resolves #7410

What changed, and why?

Adds a time_zone attribute to CasaOrg as the foundation for organization-level time-zone management.

  • Adds a non-nullable time_zone column to casa_orgs, defaulting to America/New_York.
  • Adds TZInfo-based validation for time-zone identifiers.
  • Updates the CasaOrg factory with the default time zone.
  • Adds model specs covering valid, invalid, blank, and default time-zone values.

This is the first step toward supporting organization-specific time zones for business logic, deadlines, scheduling, and notifications. Settings UI, address-based resolution, and volunteer time-zone preferences will be handled in follow-up PRs.

How is this tested? (please write rspec and jest tests!) 💖💪

  • spec/models/casa_org_spec.rb — 33 examples, 0 failures.
  • Related organization request and policy specs — 29 examples, 0 failures.
  • Verified migration, rollback, and re-application.
  • StandardRB — 0 offenses.
  • git diff --check — passed.

Screenshots please :)

Not applicable — this PR contains database and model changes only, with no UI changes.

@github-actions github-actions Bot added 🧪 Tests Tests ruby Touches Ruby code db Touches database schema or migrations labels Nov 22, 2026
@github-actions github-actions Bot added the erb Touches ERB templates label Nov 22, 2026
@KoushikSagarr
KoushikSagarr force-pushed the 7410-time-zone-management branch from e61d033 to e201491 Compare November 22, 2026 19:46
Comment on lines +36 to +39
it "is valid with another valid IANA identifier like Asia/Kolkata" do
casa_org.time_zone = "Asia/Kolkata"
expect(casa_org).to be_valid
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant with the test above. It's also hard coded. Maybe you can modify the one above to set the time zone with random IANA format time zones generated by faker. I'm not sure faker supports random IANA time zones.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db Touches database schema or migrations erb Touches ERB templates ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comprehensive Time Zone Management

2 participants