Everywhere on the internet people mention that using the rails default_scope
is a bad idea, and the top hits for default_scope
on stackoverflow are
For me is not a bad idea but must be used with caution!. There is a case where I always wanted to hide certain records when a field is set.
default_scope
must match with the DB default value (e.g: { where(hidden_id: nil) }
)unscoped
method that will avoid your default_scope
So it will depend and the real needs.