9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/models/ahoy_captain/export.rb', line 9
def build
@files["browsers.csv"] = to_csv(DeviceQuery.call(merged_params(devices_type: "browser")), DeviceDecorator)
@files["cities.csv"] = to_csv(CityQuery.call(merged_params), CityDecorator)
@files["countries.csv"] = to_csv(CountryQuery.call(merged_params), CountryDecorator)
@files["devices.csv"] = to_csv(DeviceQuery.call(merged_params(devices_type: :device_type)), DeviceDecorator)
@files["entry_pages.csv"] = to_csv(EntryPagesQuery.call(merged_params), EntryPageDecorator)
@files["exit_pages.csv"] = to_csv(ExitPagesQuery.call(merged_params), ExitPageDecorator)
@files["operating_systems.csv"] = to_csv(DeviceQuery.call(merged_params(devices_type: "os")), DeviceDecorator)
@files["top_pages.csv"] = to_csv(TopPageQuery.call(merged_params), TopPageDecorator)
@files["regions.csv"] = to_csv(RegionQuery.call(merged_params), RegionDecorator)
@files["sources.csv"] = to_csv(SourceQuery.call(merged_params), SourceDecorator)
["campaign", "content", "medium", "source", "term"].each do |utm|
@files["utm_#{utm.pluralize}.csv"] = to_csv(CampaignQuery.call(merged_params(campaigns_type: "utm_#{utm}")), CampaignDecorator)
end
self
end
|