Class: LfsObject

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/lfs_object.rb

Overview

Schema Information

Table name: lfs_objects

id         :integer          not null, primary key
oid        :string           not null
size       :integer          not null
created_at :datetime
updated_at :datetime
file       :string

Instance Method Summary collapse

Instance Method Details

#project_allowed_access?(project) ⇒ Boolean

Returns:

  • (Boolean)

29
30
31
# File 'app/models/lfs_object.rb', line 29

def project_allowed_access?(project)
  projects.exists?(storage_project(project).id)
end

#storage_project(project) ⇒ Object


21
22
23
24
25
26
27
# File 'app/models/lfs_object.rb', line 21

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