Refactor #6878
open
Replace default_scope with specific scopes for visibility
Added by Dominic Cleal over 10 years ago.
Updated over 10 years ago.
Description
default_scopes have caused a few bugs, mostly around sorting as the field used for sorting may not be available when the model is used in another query. When used to restrict visibility (e.g. #3272 for hidden users and taxonomies generally), it can break Rails associations as they assume a model can be looked up by ID (#6873).
Perhaps we should move to a more generally available scopes on every model? .visible, .sorted etc?
- Related to Bug #6873: Error during db:seed from 1.4 to 1.6: undefined method `expire_topbar_cache' for nil:NilClass added
- Status changed from New to Ready For Testing
- Target version set to 1.7.5
- Pull request https://github.com/theforeman/foreman/pull/1665 added
- Pull request deleted (
)
- Blocks Bug #6964: Error on startup: "null value in column "user_id" violates not-null constraint" added
- Assignee set to Dominic Cleal
- Translation missing: en.field_release set to 10
- Status changed from Ready For Testing to New
- Assignee deleted (
Dominic Cleal)
- Target version deleted (
1.7.5)
- Translation missing: en.field_release deleted (
10)
- Pull request added
- Pull request deleted (
https://github.com/theforeman/foreman/pull/1665)
Didn't mean to use this bug only for users.
- Blocks deleted (Bug #6964: Error on startup: "null value in column "user_id" violates not-null constraint")
- Related to Bug #6964: Error on startup: "null value in column "user_id" violates not-null constraint" added
Also available in: Atom
PDF