cartodb/app/models/carto/data_import_constants.rb
2020-06-15 10:58:47 +08:00

15 lines
446 B
Ruby

module Carto
module DataImportConstants
COLLISION_STRATEGY_SKIP = 'skip'.freeze
COLLISION_STRATEGY_OVERWRITE = 'overwrite'.freeze
VALID_COLLISION_STRATEGIES = [COLLISION_STRATEGY_SKIP, COLLISION_STRATEGY_OVERWRITE, nil].freeze
def validate_collision_strategy
unless VALID_COLLISION_STRATEGIES.include?(collision_strategy)
errors.add(:collision_strategy, "Invalid collision strategy")
end
end
end
end