Class: Distribuo::Release

Inherits:
ApplicationRecord show all
Defined in:
app/models/distribuo/release.rb

Instance Method Summary collapse

Instance Method Details

#download_url(controller, from_manifest: false) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'app/models/distribuo/release.rb', line 15

def download_url(controller, from_manifest: false)
  if app.operating_system == 'ios' && from_manifest == false
    url = controller.distribuo.app_release_manifest_url(app_id: app.id, release_id: id, host: controller.request.host,
                                                        protocol: controller.request.protocol, format: :plist)
    "itms-services://?action=download-manifest&url=#{url}"
  else
    controller.distribuo.app_release_download_url(app, self, host: controller.request.host,
                                                             protocol: controller.request.protocol)
  end
end