aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-04 22:39:34 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-04 22:49:14 -0200
commit2269f43eb36ceeacf29ab1996ae1d46b344cde86 (patch)
tree8134a9dc1151838fe54a16c7268790c69c8a8068 /railties
parent149b86d97bd14b26cdf1d408567a414418710bcf (diff)
downloadrails-2269f43eb36ceeacf29ab1996ae1d46b344cde86.tar.gz
rails-2269f43eb36ceeacf29ab1996ae1d46b344cde86.tar.bz2
rails-2269f43eb36ceeacf29ab1996ae1d46b344cde86.zip
Move class method to instance in dbconsole
This method doesn't need to be in the class, since it's only used only from the instance.
Diffstat (limited to 'railties')
-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