Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

niceties

  • Loading branch information...
commit 3a247e7c5d2085282fa26af867d29b5c5134eeaa 1 parent ec13184
rubyists authored
Showing with 11 additions and 2 deletions.
  1. +1 −1  model/condition.rb
  2. +10 −1 tasks/spec.rake
View
2  model/condition.rb
@@ -60,7 +60,7 @@ def expression_string
protected
def before_create
unless self[:position]
- self[:position] = last_position +1
+ self[:position] = last_position + 1
end
end
View
11 tasks/spec.rake
@@ -2,8 +2,17 @@ desc 'Setup postgresl database'
task :spec_setup do
require 'uri'
require 'shellwords'
+ require 'pgpass'
+
+ db = ENV['FXC_DB'] || Pgpass.match(username: Etc.getlogin)
+ if db.nil?
+ warn "please set FXC_DB or create a .pgpass for #{Etc.getlogin}"
+ warn "to set the FXC_DB variable, you can do something like:"
+ warn "export FXC_DB=postgres://user:pass@host/dbname"
+ warn "more details on pgpass at http://www.postgresql.org/docs/current/static/libpq-pgpass.html"
+ exit 1
+ end
- db = ENV['FXC_DB'] ||= 'postgres://callcenter@localhost/fxc_spec'
uri = URI(db)
case uri.scheme
when 'postgres'
Please sign in to comment.
Something went wrong with that request. Please try again.