You can see if the scope is defined or not.
Model.send(:valid_scope_name?, :scope_name)
it will return true if it exists, and nil if it is not.
Should you check the source code valid_scope_name? , you will see that you can just test it with respond_to? and then avoid the registration part.
Model.respond_to?(scope_name, true)
source share