f1479b56b7
In 8278b763d9
the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.
Fixes: #17382
20 lines
493 B
Ruby
20 lines
493 B
Ruby
class LfsObject < ActiveRecord::Base
|
|
has_many :lfs_objects_projects, dependent: :destroy
|
|
has_many :projects, through: :lfs_objects_projects
|
|
|
|
validates :oid, presence: true, uniqueness: true
|
|
|
|
mount_uploader :file, LfsObjectUploader
|
|
|
|
def storage_project(project)
|
|
if project && project.forked?
|
|
storage_project(project.forked_from_project)
|
|
else
|
|
project
|
|
end
|
|
end
|
|
|
|
def project_allowed_access?(project)
|
|
projects.exists?(storage_project(project).id)
|
|
end
|
|
end
|