Delete some environment-based conditions

We should always try to be the closest to the
production environment
This commit is contained in:
gregoirenovel 2017-04-04 11:42:42 +02:00
parent 074c6fe72b
commit 3ca914aba8
4 changed files with 5 additions and 10 deletions

View file

@ -1,6 +1,5 @@
class Notification < ActiveRecord::Base
belongs_to :dossier
serialize :liste if Rails.env.test?
# after_save :broadcast_notification

View file

@ -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

View file

@ -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

View file

@ -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