How do I add a condition to all ActiveRecords Queries for a particular model?
- by Kyle West
I am using the sentient_user gem to have access to the current_user object in my application. I want to override the default ActiveRecordBase queries to scope them to the current user.
For instance, I don't want my users looking at, deleting, modifying other user's orders.
I feel like I should be able to override a single (or couple) ActiveRecordBase methods to accomplish this, but I don't know which or how.
Thanks in advance.