diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/command/environment_argument.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/console/console_command.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/command/environment_argument.rb b/railties/lib/rails/command/environment_argument.rb index bff076adc9..05eac34155 100644 --- a/railties/lib/rails/command/environment_argument.rb +++ b/railties/lib/rails/command/environment_argument.rb @@ -13,6 +13,8 @@ module Rails def extract_environment_option_from_argument if environment self.options = options.merge(environment: acceptable_environment(environment)) + elsif !options[:environment] + self.options = options.merge(environment: Rails::Command.environment) end end diff --git a/railties/lib/rails/commands/console/console_command.rb b/railties/lib/rails/commands/console/console_command.rb index 730b108d8c..617066f575 100644 --- a/railties/lib/rails/commands/console/console_command.rb +++ b/railties/lib/rails/commands/console/console_command.rb @@ -70,7 +70,7 @@ module Rails class_option :sandbox, aliases: "-s", type: :boolean, default: false, desc: "Rollback database modifications on exit." - class_option :environment, aliases: "-e", type: :string, default: Rails::Command.environment, + class_option :environment, aliases: "-e", type: :string, desc: "Specifies the environment to run this console under (test/development/production)." def perform |