Handle Boolean scopes with has_scope
mainWhen type: :boolean is set, the scope is called without arguments if the parameter is a "true" value.
- True values:
'true'and'1'are parsed astrue. - False values: Everything else is parsed as
false. - Important: A bare parameter (e.g.,
?active) results innil, which is treated asfalse. To passtrueas an argument to a scope, use?active=trueor?active=1.
If allow_blank: true is set, the scope will be called with the actual value (including blank values) instead of just being triggered by truthiness.