aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/database.yml-example2
-rw-r--r--config/initializers/alaveteli.rb5
2 files changed, 7 insertions, 0 deletions
diff --git a/config/database.yml-example b/config/database.yml-example
index b1597e6fe..e48577f23 100644
--- a/config/database.yml-example
+++ b/config/database.yml-example
@@ -19,6 +19,8 @@ test:
password: <password>
host: localhost
port: 5432
+# Uncomment the following if the user is not a postgres superuser
+# constraint_disabling: false
production:
adapter: postgresql
diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb
index 35d486837..4acc126d0 100644
--- a/config/initializers/alaveteli.rb
+++ b/config/initializers/alaveteli.rb
@@ -59,3 +59,8 @@ require 'quiet_opener.rb'
require 'mail_handler'
require 'public_body_categories'
require 'ability'
+
+# Allow tests to be run under a non-superuser database account if required
+if Rails.env == 'test' and ActiveRecord::Base.configurations['test']['constraint_disabling'] == false
+ require 'no_constraint_disabling'
+end