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

the code is not robust against deleting a type that's in use #348

Closed
jospoortvliet opened this issue Jul 21, 2014 · 6 comments · Fixed by #567
Closed

the code is not robust against deleting a type that's in use #348

jospoortvliet opened this issue Jul 21, 2014 · 6 comments · Fixed by #567
Assignees
Labels
bug 🐛 Something is wrong and needs to be fixed

Comments

@jospoortvliet
Copy link
Member

Hi,

I removed a few track types - some of which were in use. This resulted in invalid track IDs and errors. Perhaps this should be handled a little more elegantly, either make it impossible or set invalid track ID's to 'unset'.

@hennevogel hennevogel added the Bug label Jul 24, 2014
@hennevogel
Copy link
Member

This is true for:

  • difficulty_level <> event
  • room <> event
  • track <> event
  • campaign <> target

@ChrisBr
Copy link
Member

ChrisBr commented Dec 11, 2014

As discussed with @hennevogel: We will implement this by overwriting the destroy method!

@ChrisBr ChrisBr self-assigned this Dec 11, 2014
@hennevogel
Copy link
Member

Well there are also the various :dependent options for the associations. First look at those

http://guides.rubyonrails.org/association_basics.html

@ChrisBr
Copy link
Member

ChrisBr commented Dec 11, 2014

@hennevogel Yeah, discovered the nice depended: restrict_with_error feature!

Event_type was also affected!

ChrisBr added a commit to ChrisBr/osem that referenced this issue Dec 14, 2014
ChrisBr added a commit to ChrisBr/osem that referenced this issue Dec 14, 2014
@hennevogel
Copy link
Member

:restrict_with_error is one method of handling this situation but not neccesarrily the one that should be used for everything. This is a web app, we should help people to reach their goals. If I want to delete a difficulty_level I should be able to

@jospoortvliet
Copy link
Member Author

Thanks, guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something is wrong and needs to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants