Module: Rails::Command::EnvironmentArgument

Extended by:
ActiveSupport::Concern
Included in:
BootCommand, ConsoleCommand, CredentialsCommand, DbconsoleCommand, InitializersCommand, RunnerCommand, ServerCommand
Defined in:
lib/rails/command/environment_argument.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#initializeObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rails/command/environment_argument.rb', line 16

def initialize(...)
  super

  @environment_specified = options[:environment].present?

  if !@environment_specified
    self.options = options.merge(environment: Rails::Command.environment)
  elsif !available_environments.include?(options[:environment])
    self.options = options.merge(environment: expand_environment_name(options[:environment]))
  end
end