forgeplus/app/models/repository.rb

13 lines
329 B
Ruby
Raw Normal View History

2020-03-09 00:40:16 +08:00
class Repository < ApplicationRecord
self.inheritance_column = nil # FIX The single-table inheritance mechanism failed
belongs_to :project, :touch => true
belongs_to :user
has_many :version_releases, dependent: :destroy
validates :identifier, presence: true
def to_param
self.identifier.parameterize
end
end