Skip to content

act_as_paranoid integrity breakage for instances #386

Open
@martinpovolny

Description

@martinpovolny

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" #

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions