For example, given I defined scopes for the class Task, is there a way to find all scope names for that class?
I'm looking for something like:
Task.scope_names
which would output something like:
["completed", "uncompleted", "pending"]
Any ideas on how to do so?
According to docs
such methods as
Model.scopes
#=> outputs all scopes
and
Model.send(:valid_scope_name?, scope_name)
#=> takes scope name as an argument and returns either true or false
are no longer available since Rails 3.1.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With