You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/app/model_factories/map_factory.rb

14 lines
347 B

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