cartodb-4.42/app/model_factories/map_factory.rb
2024-04-06 05:25:13 +00:00

14 lines
347 B
Ruby

module ModelFactories
class MapFactory
def self.get_map(base_layer, user_id, table_id = nil)
provider = ::Map.provider_for_baselayer_kind(base_layer.kind)
options = ::Map::DEFAULT_OPTIONS.merge(user_id: user_id, provider: provider)
options[:table_id] = table_id if table_id
::Map.create(options)
end
end
end