We have a web app which serves typical social content(blogs/forums/streams etc).
All the content is optionally marked with a city. I.e. if a blog post is specific to New York, it will be marked so.
The task is to show only city specific information(all over the site) if user has set city view preference and show everything to all others.
So I have to add 'and city == current_city' if city_specifc_view? to all my finders in all my model classes, which is a maintenance night mare(especially as there is a risk of this logic changing).
I am wondering what is the right way to apply this logic. Can I do it a central place(like overrinding the default find), instead of if/else all over the models. Is monkey patching ActiveRecord an option?
Thanks