class Rails::Command::ConsoleCommand
:nodoc:
def initialize(args = [], local_options = {}, config = {})
def initialize(args = [], local_options = {}, config = {}) console_options = [] # For the same behavior as OptionParser, leave only options after "--" in ARGV. termination = local_options.find_index("--") if termination console_options = local_options[termination + 1..-1] local_options = local_options[0...termination] end ARGV.replace(console_options) super(args, local_options, config) end
def perform
def perform extract_environment_option_from_argument # RAILS_ENV needs to be set before config/application is required. ENV["RAILS_ENV"] = options[:environment] require_application_and_environment! Rails::Console.start(Rails.application, options) end