DEV Community

Discussion on: How to Use Scopes in Ruby on Rails

Collapse
bizzibody profile image
Ian bradbury

Scopes are great but it's worth highlighting, when a scope returns nil, all records are returned. This can cause unexpected consequences - especially when the scope is being used to limit access to data.