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

act_as_paranoid integrity breakage for instances #386

Open
martinpovolny opened this issue Jan 28, 2013 · 1 comment
Open

act_as_paranoid integrity breakage for instances #386

martinpovolny opened this issue Jan 28, 2013 · 1 comment
Labels

Comments

@martinpovolny
Copy link

The logic taking care of the referencial integrity between Instance and ProviderAccount is probably twisted.

Below is an error I got after adding a FK constraint to instances that references ProviderAccounts.

While it should be possible from the database point of view to delete the provider accout that is referenced byt an instance (because the soft delete just sets the deleted_at and the record remains in the database).

It should not be possible on the application level which I suspect is the case of the test in this issue.

However I am not sure, have to check later on.

features/provider_account.feature:48
...
Then I should be on the mockprovider's show provider page # features/step_definitions/web_steps.rb:203
And I should see "was deleted" # features/step_definitions/web_steps.rb:121
expected there to be content "was deleted" in "\nInternal Server Error\nAeolus Conductor\n\n\n\n //\n\n\n\n\n\n\nAeolus Conductor\n\n\n\n\nMonitorAdminister\n\nJohn Smith\nLog Out\n\n\n\n\nERROR: update or delete on table "provider_accounts" violates foreign key constraint "instances_provider_account_id_fk" on table "instances"\nDETAIL: Key (id)=(1) is still referenced from table "instances".\n\n\n\n\n\n\n\n\n\n\n" (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/web_steps.rb:123:in /^(?:|I )should see "([^"]*)"$/' features/provider_account.feature:63:inAnd I should see "was deleted"'
And there should be no provider account "testaccount" #

@martinpovolny
Copy link
Author

#387 -- the same problem for deployment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant