lfs_object.rb 397 Bytes
Newer Older
Marin Jankovski's avatar
Marin Jankovski committed
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

  def storage_project(project)
    if project && project.forked?
11
      storage_project(project.forked_from_project)
12 13 14 15
    else
      project
    end
  end
Marin Jankovski's avatar
Marin Jankovski committed
16
end