- CLASS Project::TransferError
- A
- B
- C
- F
- G
- I
- L
- P
- R
- S
- T
- W
[RW] | error_code |
Source: show
# File app/models/project.rb, line 163 def access_options UsersProject.access_roles end
Source: show
# File app/models/project.rb, line 96 def active joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC") end
Source: show
# File app/models/project.rb, line 114 def create_by_user(params, user) namespace_id = params.delete(:namespace_id) project = Project.new params Project.transaction do # Parametrize path for project # # Ex. # 'GitLab HQ'.parameterize => "gitlab-hq" # project.path = project.name.dup.parameterize project.owner = user # Apply namespace if user has access to it # else fallback to user namespace if namespace_id != Namespace.global_id project.namespace_id = user.namespace_id if namespace_id group = Group.find_by_id(namespace_id) if user.can? :manage_group, group project.namespace_id = namespace_id end end end project.save! # Add user as project master project.users_projects.create!(project_access: UsersProject::MASTER, user: user) # when project saved no team member exist so # project repository should be updated after first user add project.update_repository end project rescue Gitlab::Gitolite::AccessDenied => ex project.error_code = :gitolite project rescue => ex project.error_code = :db project.errors.add(:base, "Can't save project. Please try again later") project end
Source: show
# File app/models/project.rb, line 104 def find_with_namespace(id) if id.include?("/") id = id.split("/") namespace_id = Namespace.find_by_path(id.first).id where(namespace_id: namespace_id).find_by_path(id.second) else where(path: id, namespace_id: nil).last end end
Source: show
# File app/models/project.rb, line 100 def search query where("projects.name LIKE :query OR projects.path LIKE :query", query: "%#{query}%") end
Source: show
# File app/models/project.rb, line 208 def build_commit_note(commit) notes.new(commit_id: commit.id, noteable_type: "Commit") end
Source: show
# File app/models/project.rb, line 176 def check_limit unless owner.can_create_project? errors[:base] << ("Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it") end rescue errors[:base] << ("Can't check your ability to create project") end
For compatibility with old code
Source: show
# File app/models/project.rb, line 253 def code path end
Source: show
# File app/models/project.rb, line 216 def commit_line_notes(commit) notes.where(commit_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL") end
Source: show
# File app/models/project.rb, line 212 def commit_notes(commit) notes.where(commit_id: commit.id, noteable_type: "Commit", line_code: nil) end
Source: show
# File app/models/project.rb, line 204 def common_notes notes.where(noteable_type: ["", nil]).inc_author_project end
Source: show
# File app/models/project.rb, line 168 def git_error? error_code == :gitolite end
Source: show
# File app/models/project.rb, line 248 def gitlab_ci? gitlab_ci_service && gitlab_ci_service.active end
Source: show
# File app/models/project.rb, line 240 def issues_labels issues.tag_counts_on(:labels) end
Source: show
# File app/models/project.rb, line 257 def items_for entity case entity when 'issue' then issues when 'merge_request' then merge_requests end end
Source: show
# File app/models/project.rb, line 228 def last_activity last_event end
Source: show
# File app/models/project.rb, line 232 def last_activity_date last_event.try(:created_at) || updated_at end
Source: show
# File app/models/project.rb, line 184 def repo_name denied_paths = %w(gitolite-admin admin dashboard groups help profile projects search) if denied_paths.include?(path) errors.add(:path, "like #{path} is not allowed") end end
Source: show
# File app/models/project.rb, line 266 def send_move_instructions self.users_projects.each do |member| Notify.project_was_moved_email(member.id).deliver end end
Source: show
# File app/models/project.rb, line 244 def services [gitlab_ci_service].compact end