From 3ca914aba80741c7d4418da7529f352bb74c7a61 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Tue, 4 Apr 2017 11:42:42 +0200 Subject: [PATCH] Delete some environment-based conditions We should always try to be the closest to the production environment --- app/models/notification.rb | 1 - ...0160127170437_change_date_creation_type_to_entreprise.rb | 6 +----- db/migrate/20161025150900_create_searches.rb | 4 ++-- db/migrate/20161102154835_update_searches_to_version_2.rb | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index e538f0a25..4ff810f37 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -1,6 +1,5 @@ class Notification < ActiveRecord::Base belongs_to :dossier - serialize :liste if Rails.env.test? # after_save :broadcast_notification diff --git a/db/migrate/20160127170437_change_date_creation_type_to_entreprise.rb b/db/migrate/20160127170437_change_date_creation_type_to_entreprise.rb index 5168938c7..6451dc0d1 100644 --- a/db/migrate/20160127170437_change_date_creation_type_to_entreprise.rb +++ b/db/migrate/20160127170437_change_date_creation_type_to_entreprise.rb @@ -1,10 +1,6 @@ class ChangeDateCreationTypeToEntreprise < ActiveRecord::Migration def up - if Rails.env.test? - change_column :entreprises, :date_creation, "timestamp" - else - change_column :entreprises, :date_creation, "timestamp USING to_timestamp(date_creation) at time zone 'UTC-2'" - end + change_column :entreprises, :date_creation, "timestamp USING to_timestamp(date_creation) at time zone 'UTC-2'" end def down diff --git a/db/migrate/20161025150900_create_searches.rb b/db/migrate/20161025150900_create_searches.rb index 5252c6006..3b2ee975f 100644 --- a/db/migrate/20161025150900_create_searches.rb +++ b/db/migrate/20161025150900_create_searches.rb @@ -9,7 +9,7 @@ class CreateSearches < ActiveRecord::Migration add_index :individuals, :dossier_id add_index :pieces_justificatives, :dossier_id add_index :rna_informations, :entreprise_id - create_view :searches unless Rails.env.test? #, materialized: true + create_view :searches end def down @@ -22,6 +22,6 @@ class CreateSearches < ActiveRecord::Migration remove_index :individuals, :dossier_id remove_index :pieces_justificatives, :dossier_id remove_index :rna_informations, :entreprise_id - drop_view :searches unless Rails.env.test? #, materialized: true + drop_view :searches end end diff --git a/db/migrate/20161102154835_update_searches_to_version_2.rb b/db/migrate/20161102154835_update_searches_to_version_2.rb index b749a08ea..55223b4cf 100644 --- a/db/migrate/20161102154835_update_searches_to_version_2.rb +++ b/db/migrate/20161102154835_update_searches_to_version_2.rb @@ -1,9 +1,9 @@ class UpdateSearchesToVersion2 < ActiveRecord::Migration def up - replace_view :searches, version: 2 unless Rails.env.test? + replace_view :searches, version: 2 end def down - replace_view :searches, version: 1 unless Rails.env.test? + replace_view :searches, version: 1 end end