cartodb-4.42/app/models/carto/data_import_constants.rb

15 lines
446 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
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