Welcome to mirror list, hosted at ThFree Co, Russian Federation.

download.rb « models « app - github.com/git/git-scm.com.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6a27984bfcc29e579bdc27060638b7a9ad0e6769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

# t.string :url
# t.string :filename
# t.string :platform
# t.references :version
# t.timestamp :release_date
# t.timestamps
class Download < ApplicationRecord
  belongs_to :version

  def self.latest_for(platform)
    includes(:version).where("platform=?", platform).order("versions.vorder DESC").order("downloads.release_date DESC").first
  end
end