In the Ruby on Rails application, I have a controller where I would like some functions to be executed conditionally, where the condition depends on the environment in which the application runs. As a far-fetched example in development mode, I would like to do this:
if foo == 5:
...
end
And in production mode, I would like to:
if foo > 6:
...
end
The difference between the two conditions is more complex than one constant (5 or 6 in the above example).
What is the most idiomatic way to do this in Rails? Can I write helper methods directly in files environments/? Or add a method to an application controller that checks the current environment? Or something else?