This project is archived and is in readonly mode.
rails console loads "production" env with "t" argument
Reported by Akira Matsuda | September 2nd, 2010 @ 04:32 AM | in 3.x
The console command regards the environment argument as the following:
% rails console t
Loading production environment (Rails 3.0.0)
>> Rails.env
=> "production"
% rails console d
Loading production environment (Rails 3.0.0)
>> Rails.env
=> "production"
This behavior is caused by this logic:
%w(production development test).find { |e| e.index(env) }
because both 't' and 'd' are included in 'production'.
I guess this is not intentional, so attached a patch to forward match the argument.
Comments and changes to this ticket
-
Neeraj Singh September 2nd, 2010 @ 05:54 AM
- Milestone set to 3.x
- State changed from new to open
- Assigned user set to José Valim
- Importance changed from to Low
+1 looks good to me. Did not test the actual code though.
-
Repository September 2nd, 2010 @ 10:58 AM
- State changed from open to resolved
(from [3e931b196197225ce22fff180e519d73316772c9]) "rails console t" must not load "production" but "test" [#5527 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/3e931b196197225ce22fff180e519d...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 5527 rails console loads "production" env with "t" argument (from [3e931b196197225ce22fff180e519d73316772c9]) "rails ...
- 6293 rails dbconsole loads "production" env with "t" argument This is dbconsole version of #5527
- 6293 rails dbconsole loads "production" env with "t" argument Attached a patch with exactly the same fix with #5527