i got two controller (with restful actions) where my code is quite
ugly and not very dry. every action looks quite like this:
this is a security check that enforce a simple spec: normal user
should read/write information only about their group’s users, but
“admin” users can read/write about all users.
The other controller is quite similar, just on another model.
trying to refactor a was reading about using a with_scope in an
this seems to work and the code gets a lot smaller. But it seems to be
a deprecated practice…
What is the “rails way” to accomplish this?