2020-03-09 00:40:16 +08:00
|
|
|
class VersionRelease < ApplicationRecord
|
2020-05-13 17:07:41 +08:00
|
|
|
belongs_to :repository, counter_cache: true
|
2020-03-09 00:40:16 +08:00
|
|
|
belongs_to :user
|
|
|
|
|
has_many :project_trends, as: :trend, dependent: :destroy
|
2020-05-13 17:15:22 +08:00
|
|
|
scope :releases_size, ->{where(draft: false, prerelease: false).size}
|
2020-05-20 14:43:14 +08:00
|
|
|
has_many :attachments, as: :container, dependent: :destroy
|
2020-03-09 00:40:16 +08:00
|
|
|
end
|