aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/commands/console.rb1
-rw-r--r--railties/lib/rails/commands/dbconsole.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb
index 35a9072f51..11275d7ea9 100644
--- a/railties/lib/rails/commands/console.rb
+++ b/railties/lib/rails/commands/console.rb
@@ -35,6 +35,7 @@ module Rails
end
private
+
def available_environments
Dir[Rails.root.join('config', 'environments', '*.rb')].map { |fname| File.basename(fname, '.*') }
end
diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb
index 353a64fd01..2d1e2d6a45 100644
--- a/railties/lib/rails/commands/dbconsole.rb
+++ b/railties/lib/rails/commands/dbconsole.rb
@@ -136,7 +136,7 @@ module Rails
if arguments.first && arguments.first[0] != '-'
env = arguments.first
- if self.class.available_environments.include? env
+ if available_environments.include? env
options[:environment] = env
else
options[:environment] = %w(production development test).detect {|e| e =~ /^#{env}/} || env
@@ -146,7 +146,7 @@ module Rails
options
end
- def self.available_environments
+ def available_environments
Dir[Rails.root.join('config', 'environments', '*.rb')].map { |fname| File.basename(fname, '.*') }
end