Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added dbconsole command -- thanks @jcf!

  • Loading branch information...
commit c0cc8c77f84d916719197df9fe43816a632a1a34 1 parent 8dfc275
@burke authored
Showing with 18 additions and 1 deletion.
  1. +2 −1  examples/zeus.json
  2. +16 −0 rubygem/lib/zeus/rails.rb
View
3  examples/zeus.json
@@ -9,7 +9,8 @@
"runner": ["r"],
"console": ["c"],
"server": ["s"],
- "generate": ["g"]
+ "generate": ["g"],
+ "dbconsole": []
},
"test_environment": {
"cucumber_environment": {"cucumber": []},
View
16 rubygem/lib/zeus/rails.rb
@@ -117,6 +117,22 @@ def console
::Rails::Console.start(::Rails.application)
end
+ def dbconsole
+ require 'rails/commands/dbconsole'
+
+ meth = ::Rails::DBConsole.method(:start)
+
+ # `Rails::DBConsole.start` has been changed to load faster in
+ # https://github.com/rails/rails/commit/346bb018499cde6699fcce6c68dd7e9be45c75e1
+ #
+ # This will work with both versions.
+ if meth.arity.zero?
+ ::Rails::DBConsole.start
+ else
+ ::Rails::DBConsole.start(::Rails.application)
+ end
+ end
+
def server
require 'rails/commands/server'
server = ::Rails::Server.new

1 comment on commit c0cc8c7

@jcf

You're more than welcome. Thank you for Zeus!

Please sign in to comment.
Something went wrong with that request. Please try again.