Hi,
Today I implemented a small piece of code that include analytics only in production environment using something like:
<% if Rails.env.production? %>
analytics here
<% end %>
I don't see anything wrong about it... however one of my c0-workers told me that it wasn't a good practice at all, that it would for sure introduce problems in a future maintaining phase and that was much better to set up a constant in the environment and do something like
<% if defined?(INCLUDE_ANALYTICS) && INCLUDE_ANALYTICS %>
analytics here
<% end %>
I don't see such a big difference between these 2 approaches, however I would like to see what other developers think about it and how would other solve this in a better way :)