lib/pgcli/rails/tasks.rake in pgcli-rails-0.2.1 vs lib/pgcli/rails/tasks.rake in pgcli-rails-0.3.0

- old
+ new

@@ -3,8 +3,14 @@ require "pgcli/rails/dbconsole" # APP_PATH constant must be set for DBConsole to work APP_PATH = Rails.root.join("config", "application") unless defined?(APP_PATH) - console = Pgcli::Rails::DBConsole.new(["--include-password"]) + opt = if ::Rails.version >= "5.1" + { "--include-password" => true } + else + ["--include-password"] + end + + console = Pgcli::Rails::DBConsole.new(opt) console.start end