[openstreetmap/openstreetmap-website] Is there still a need for if_user and friends? (#1862)

Andy Allan notifications at github.com
Tue May 15 08:00:23 UTC 2018


In the application helpers we have a few methods that allow features to be shown and hidden using CSS, based on the logged in user_id. The methods have pretty much remained as they were when added in https://github.com/openstreetmap/openstreetmap-website/commit/51195c450d16e35a62bff2bbf6c9dd0923bd0db4

Elsewhere in the codebase we take a more "normal" approach, which is to e.g. not add the html to the page based on the conditions, rather than this approach of adding the html to the page unconditionally and then hiding it with CSS.

If I had to guess, I would say that the approach was intended to allow more aggressive page fragment caching, but as far as I'm aware we don't actually do anything like this (or perhaps never have done?). Or maybe I've misunderstood their purpose entirely.

I propose removing these methods and converting their uses to e.g. "if current_user..." as per elsewhere on the site, but I thought I'd ask here first - do we actually need them?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/1862
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180515/c3e67689/attachment.html>


More information about the rails-dev mailing list