I want to be able to set permissions based on a joining table.
so...
Post.restrict!(current_user).joins(:category)
In this situation the current user doesn't have direct access to category but can get category through Post. How would I accomplish this? It's applying the default category scope and I don't see a way to make it conditional based on the joining table.
I want to be able to set permissions based on a joining table.
so...
Post.restrict!(current_user).joins(:category)
In this situation the current user doesn't have direct access to category but can get category through Post. How would I accomplish this? It's applying the default category scope and I don't see a way to make it conditional based on the joining table.