Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 Sections: Destroying a Section with Gizmos fails horribly #2019

Closed
sentry-io bot opened this issue Dec 11, 2023 · 1 comment
Closed

🐞 Sections: Destroying a Section with Gizmos fails horribly #2019

sentry-io bot opened this issue Dec 11, 2023 · 1 comment
Assignees
Labels
🐞 bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Dec 11, 2023

Sentry Issue: CONVENE-2C

PG::ForeignKeyViolation: ERROR:  update or delete on table "furnitures" violates foreign key constraint "fk_rails_b0aa115297" on table "marketplace_notification_methods" (PG::ForeignKeyViolation)
DETAIL:  Key (id)=(c8231e41-0f1f-4410-b371-2e4ecff798af) is still referenced from table "marketplace_notification_methods".

  app/controllers/rooms_controller.rb:41:in `destroy'
    if room.destroy
  app/models/neighborhood/time_zone_mixin.rb:7:in `set_time_zone'
    Time.use_zone(ENV.fetch("NEIGHBORHOOD_TIME_ZONE"), &block)
...
(144 additional frame(s) were not displayed)

ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR:  update or delete on table "furnitures" violates foreign key constraint "fk_rails_b0aa115297" on table "marketplace_notification_methods" (ActiveRecord::InvalidForeignKey)
DETAIL:  Key (id)=(c8231e41-0f1f-4410-b371-2e4ecff798af) is still referenced from table "marketplace_notification_methods".
@zspencer zspencer added the 🐞 bug Something isn't working label Dec 11, 2023
@zspencer zspencer changed the title ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR: update or delete on table "furnitures" violates foreign key cons... 🐞 Sections: Destroying a Section with Gizmos fails horribly Dec 11, 2023
@zspencer zspencer self-assigned this Dec 11, 2023
zspencer added a commit that referenced this issue Dec 11, 2023
- #2019

There's probably a smarter thing to do here; but it will have to wait
til we turn on Rails polymorphism for Gizmos.

As it stands, trying to destroy Gizmos when they aren't instantiated as
their actual Type results in a lot of foreign key violations.
zspencer added a commit that referenced this issue Dec 11, 2023
- #2019

There's probably a smarter thing to do here; but it will have to wait
til we turn on Rails polymorphism for Gizmos.

As it stands, trying to destroy Gizmos when they aren't instantiated as
their actual Type results in a lot of foreign key violations.
@zspencer
Copy link
Member

I've resolved this by preventing removal of Sections with Gizmos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant