Schema Information

Table name: namespaces

id         :integer          not null, primary key
name       :string(255)      not null
path       :string(255)      not null
owner_id   :integer          not null
created_at :datetime         not null
updated_at :datetime         not null
type       :string(255)
Methods
D
E
G
H
M
N
R
S
T
U
Class Public methods
global_id()
# File app/models/namespace.rb, line 41
def self.global_id
  'GLN'
end
# File app/models/namespace.rb, line 37
def self.search query
  where("name LIKE :query OR path LIKE :query", query: "%#{query}%")
end
Instance Public methods
dir_exists?()
# File app/models/namespace.rb, line 59
def dir_exists?
  File.exists?(namespace_full_path)
end
ensure_dir_exist()
# File app/models/namespace.rb, line 53
def ensure_dir_exist
  unless dir_exists?
    system("mkdir -m 770 #{namespace_full_path}")
  end
end
human_name()
# File app/models/namespace.rb, line 49
def human_name
  owner_name
end
move_dir()
# File app/models/namespace.rb, line 67
def move_dir
  if path_changed?
    old_path = File.join(Gitlab.config.gitolite.repos_path, path_was)
    new_path = File.join(Gitlab.config.gitolite.repos_path, path)
    if File.exists?(new_path)
      raise "Already exists"
    end

    if system("mv #{old_path} #{new_path}")
      send_update_instructions
      @require_update_gitolite = true
    else
      raise "Namespace move error #{old_path} #{new_path}"
    end
  end
end
namespace_full_path()
# File app/models/namespace.rb, line 63
def namespace_full_path
  @namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path)
end
rm_dir()
# File app/models/namespace.rb, line 89
def rm_dir
  dir_path = File.join(Gitlab.config.gitolite.repos_path, path)
  system("rm -rf #{dir_path}")
end
send_update_instructions()
# File app/models/namespace.rb, line 94
def send_update_instructions
  projects.each(&:send_move_instructions)
end
to_param()
# File app/models/namespace.rb, line 45
def to_param
  path
end
update_gitolite()
# File app/models/namespace.rb, line 84
def update_gitolite
  @require_update_gitolite = false
  projects.each(&:update_repository)
end