BigW Consortium Gitlab

lfs_object.rb 380 Bytes
Newer Older
1 2 3 4 5 6 7
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
8 9 10 11 12 13 14 15

  def storage_project(project)
    if project && project.forked?
      project.forked_from_project
    else
      project
    end
  end
16
end