aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/initializers/stif.rb6
-rw-r--r--db/migrate/20171001100642_stif_define_custom_view_for_organisations.rb5
2 files changed, 11 insertions, 0 deletions
diff --git a/config/initializers/stif.rb b/config/initializers/stif.rb
index f20429575..ad2ea6ed3 100644
--- a/config/initializers/stif.rb
+++ b/config/initializers/stif.rb
@@ -13,5 +13,11 @@ Rails.application.config.to_prepare do
end unless Rails.env.test?
Rails.application.config.to_prepare do
+ Organisation.before_validation(on: :create) do |organisation|
+ organisation.custom_view = "stif"
+ end
+end
+
+Rails.application.config.to_prepare do
Dashboard.default_class = Stif::Dashboard
end
diff --git a/db/migrate/20171001100642_stif_define_custom_view_for_organisations.rb b/db/migrate/20171001100642_stif_define_custom_view_for_organisations.rb
new file mode 100644
index 000000000..304c90a1a
--- /dev/null
+++ b/db/migrate/20171001100642_stif_define_custom_view_for_organisations.rb
@@ -0,0 +1,5 @@
+class StifDefineCustomViewForOrganisations < ActiveRecord::Migration
+ def change
+ Organisation.update_all custom_view: "stif"
+ end
+end