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 b75c5f082..a9e9d498d 100644
--- a/config/initializers/alaveteli.rb
+++ b/config/initializers/alaveteli.rb
@@ -61,3 +61,8 @@ require 'public_body_categories'
require 'ability'
require 'normalize_string'
require 'alaveteli_file_types'
+
+# 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