Browse Source

Disable collection year validations on review apps

pull/2147/head
Kat 2 years ago
parent
commit
ca9e175bb7
  1. 2
      app/models/validations/setup_validations.rb
  2. 8
      app/services/feature_toggle.rb

2
app/models/validations/setup_validations.rb

@ -3,7 +3,7 @@ module Validations::SetupValidations
include CollectionTimeHelper include CollectionTimeHelper
def validate_startdate_setup(record) def validate_startdate_setup(record)
return unless record.startdate && date_valid?("startdate", record) return unless record.startdate && date_valid?("startdate", record) && FeatureToggle.startdate_collection_window_validation_enabled?
first_collection_start_date = if record.startdate_was.present? first_collection_start_date = if record.startdate_was.present?
editable_collection_start_date editable_collection_start_date

8
app/services/feature_toggle.rb

@ -1,7 +1,11 @@
class FeatureToggle class FeatureToggle
# Disable check on preview apps to allow for testing of future forms # Disable check on preview apps to allow for testing of future forms
def self.saledate_collection_window_validation_enabled? def self.saledate_collection_window_validation_enabled?
true Rails.env.production? || Rails.env.test? || Rails.env.staging?
end
def self.startdate_collection_window_validation_enabled?
Rails.env.production? || Rails.env.test? || Rails.env.staging?
end end
def self.startdate_two_week_validation_enabled? def self.startdate_two_week_validation_enabled?
@ -9,7 +13,7 @@ class FeatureToggle
end end
def self.saledate_two_week_validation_enabled? def self.saledate_two_week_validation_enabled?
Rails.env.production? || Rails.env.test? || Rails.env.staging? || Rails.env.review? Rails.env.production? || Rails.env.test? || Rails.env.staging?
end end
def self.bulk_upload_duplicate_log_check_enabled? def self.bulk_upload_duplicate_log_check_enabled?

Loading…
Cancel
Save