Why would a Rails application explicitly declare config.gem 'rails' in environment.rb?
-
06-07-2019 - |
Question
A sample application I was looking at has this in environment.rb
:
config.gem 'rails'
Is this redundant code or is there likely to be a reason the programmer did this?
Solution
It's redundant code.
OTHER TIPS
I guess you could use that if you had multiple versions of the Rails gem, and didn't freeze Rails into your application, so you could do something like
config.gem 'rails', :version => 2.2.2
But otherwise, it's redundant.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow