Skip to content

Allow users to edit time_zone via nested attributes on Person form#1001

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/fix-issue-929
Draft

Allow users to edit time_zone via nested attributes on Person form#1001
Copilot wants to merge 6 commits intomainfrom
copilot/fix-issue-929

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

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

Users cannot edit their timezone preferences because the User edit form is only accessible to admins. This PR makes the time_zone field editable through the Person form, which regular users can access.

How did you approach the change?

Person form:

  • Added time_zone field using nested user_attributes via fields_for :user
  • Field only displays when the person has an associated user

User form:

  • Made time_zone conditionally editable based on whether user has a person
  • If user has a person: displays as read-only with link to edit on person profile
  • If user has no person: displays as editable field (for legacy users)

Controller:

  • Added :time_zone to user_attributes permitted parameters in PeopleController

Anything else to add?

This approach keeps time_zone on the User model where it belongs (User is the authenticated entity) while making it accessible for regular users to edit through their Person profile. No database migrations are needed.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 15, 2026 06:57
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue #929 in the application Move time_zone from User to Person Feb 15, 2026
Copilot AI requested a review from maebeale February 15, 2026 07:02
@maebeale
Copy link
Collaborator

@copilot leave time_zone on user, but add it to nested attributes on person form. only show it on user form if the user doesn't have a person.

…field

Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 15, 2026

@copilot leave time_zone on user, but add it to nested attributes on person form. only show it on user form if the user doesn't have a person.

Done in commit 61078e2.

Changes:

  • Removed migrations that would have moved time_zone
  • time_zone stays on User model with validation
  • Person form now edits time_zone via nested user_attributes (only shows when person has a user)
  • User form only shows editable time_zone when user doesn't have a person, otherwise shows read-only with link to person profile

Copilot AI changed the title Move time_zone from User to Person Allow users to edit time_zone via nested attributes on Person form Feb 15, 2026
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.

2 participants