1203 lines
41 KiB
HTML
1203 lines
41 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
|
|
<title>class Project - Rails Application Documentation</title>
|
|
|
|
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
|
|
|
<script type="text/javascript">
|
|
var rdoc_rel_prefix = "./";
|
|
</script>
|
|
|
|
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
|
|
|
|
|
<body id="top" class="class">
|
|
<nav id="metadata">
|
|
<nav id="home-section" class="section">
|
|
<h3 class="section-header">
|
|
<a href="./index.html">Home</a>
|
|
<a href="./table_of_contents.html#classes">Classes</a>
|
|
<a href="./table_of_contents.html#methods">Methods</a>
|
|
</h3>
|
|
</nav>
|
|
|
|
|
|
<nav id="search-section" class="section project-section" class="initially-hidden">
|
|
<form action="#" method="get" accept-charset="utf-8">
|
|
<h3 class="section-header">
|
|
<input type="text" name="search" placeholder="Search" id="search-field"
|
|
title="Type to search, Up and Down to navigate, Enter to load">
|
|
</h3>
|
|
</form>
|
|
|
|
<ul id="search-results" class="initially-hidden"></ul>
|
|
</nav>
|
|
|
|
|
|
<div id="file-metadata">
|
|
<nav id="file-list-section" class="section">
|
|
<h3 class="section-header">Defined In</h3>
|
|
<ul>
|
|
<li>app/models/project.rb
|
|
</ul>
|
|
</nav>
|
|
|
|
|
|
</div>
|
|
|
|
<div id="class-metadata">
|
|
|
|
<nav id="parent-class-section" class="section">
|
|
<h3 class="section-header">Parent</h3>
|
|
|
|
<p class="link">ActiveRecord::Base
|
|
|
|
</nav>
|
|
|
|
<!-- Included Modules -->
|
|
<nav id="includes-section" class="section">
|
|
<h3 class="section-header">Included Modules</h3>
|
|
|
|
<ul class="link-list">
|
|
|
|
|
|
<li><a class="include" href="Repository.html">Repository</a>
|
|
|
|
|
|
|
|
<li><a class="include" href="PushObserver.html">PushObserver</a>
|
|
|
|
|
|
|
|
<li><a class="include" href="Authority.html">Authority</a>
|
|
|
|
|
|
|
|
<li><a class="include" href="Team.html">Team</a>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
<!-- Method Quickref -->
|
|
<nav id="method-list-section" class="section">
|
|
<h3 class="section-header">Methods</h3>
|
|
|
|
<ul class="link-list">
|
|
|
|
<li><a href="#method-c-access_options">::access_options</a>
|
|
|
|
<li><a href="#method-c-active">::active</a>
|
|
|
|
<li><a href="#method-c-create_by_user">::create_by_user</a>
|
|
|
|
<li><a href="#method-c-search">::search</a>
|
|
|
|
<li><a href="#method-i-build_commit_note">#build_commit_note</a>
|
|
|
|
<li><a href="#method-i-check_limit">#check_limit</a>
|
|
|
|
<li><a href="#method-i-commit_line_notes">#commit_line_notes</a>
|
|
|
|
<li><a href="#method-i-commit_notes">#commit_notes</a>
|
|
|
|
<li><a href="#method-i-common_notes">#common_notes</a>
|
|
|
|
<li><a href="#method-i-git_error-3F">#git_error?</a>
|
|
|
|
<li><a href="#method-i-issues_labels">#issues_labels</a>
|
|
|
|
<li><a href="#method-i-last_activity">#last_activity</a>
|
|
|
|
<li><a href="#method-i-last_activity_date">#last_activity_date</a>
|
|
|
|
<li><a href="#method-i-private-3F">#private?</a>
|
|
|
|
<li><a href="#method-i-project_id">#project_id</a>
|
|
|
|
<li><a href="#method-i-public-3F">#public?</a>
|
|
|
|
<li><a href="#method-i-repo_name">#repo_name</a>
|
|
|
|
<li><a href="#method-i-saved-3F">#saved?</a>
|
|
|
|
<li><a href="#method-i-to_param">#to_param</a>
|
|
|
|
<li><a href="#method-i-web_url">#web_url</a>
|
|
|
|
<li><a href="#method-i-wiki_notes">#wiki_notes</a>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
<div id="project-metadata">
|
|
<nav id="fileindex-section" class="section project-section">
|
|
<h3 class="section-header">Pages</h3>
|
|
|
|
<ul>
|
|
|
|
<li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
<nav id="classindex-section" class="section project-section">
|
|
<h3 class="section-header">Class and Module Index</h3>
|
|
|
|
<ul class="link-list">
|
|
|
|
<li><a href="./Gitlab.html">Gitlab</a>
|
|
|
|
<li><a href="./Gitlab/API.html">Gitlab::API</a>
|
|
|
|
<li><a href="./Gitlab/APIHelpers.html">Gitlab::APIHelpers</a>
|
|
|
|
<li><a href="./Gitlab/AppLogger.html">Gitlab::AppLogger</a>
|
|
|
|
<li><a href="./Gitlab/Auth.html">Gitlab::Auth</a>
|
|
|
|
<li><a href="./Gitlab/Encode.html">Gitlab::Encode</a>
|
|
|
|
<li><a href="./Gitlab/Entities.html">Gitlab::Entities</a>
|
|
|
|
<li><a href="./Gitlab/Entities/Hook.html">Gitlab::Entities::Hook</a>
|
|
|
|
<li><a href="./Gitlab/Entities/Issue.html">Gitlab::Entities::Issue</a>
|
|
|
|
<li><a href="./Gitlab/Entities/Milestone.html">Gitlab::Entities::Milestone</a>
|
|
|
|
<li><a href="./Gitlab/Entities/Project.html">Gitlab::Entities::Project</a>
|
|
|
|
<li><a href="./Gitlab/Entities/ProjectMember.html">Gitlab::Entities::ProjectMember</a>
|
|
|
|
<li><a href="./Gitlab/Entities/ProjectSnippet.html">Gitlab::Entities::ProjectSnippet</a>
|
|
|
|
<li><a href="./Gitlab/Entities/RepoCommit.html">Gitlab::Entities::RepoCommit</a>
|
|
|
|
<li><a href="./Gitlab/Entities/RepoObject.html">Gitlab::Entities::RepoObject</a>
|
|
|
|
<li><a href="./Gitlab/Entities/SSHKey.html">Gitlab::Entities::SSHKey</a>
|
|
|
|
<li><a href="./Gitlab/Entities/User.html">Gitlab::Entities::User</a>
|
|
|
|
<li><a href="./Gitlab/Entities/UserBasic.html">Gitlab::Entities::UserBasic</a>
|
|
|
|
<li><a href="./Gitlab/Entities/UserLogin.html">Gitlab::Entities::UserLogin</a>
|
|
|
|
<li><a href="./Gitlab/FileEditor.html">Gitlab::FileEditor</a>
|
|
|
|
<li><a href="./Gitlab/GitLogger.html">Gitlab::GitLogger</a>
|
|
|
|
<li><a href="./Gitlab/Gitolite.html">Gitlab::Gitolite</a>
|
|
|
|
<li><a href="./Gitlab/Gitolite/AccessDenied.html">Gitlab::Gitolite::AccessDenied</a>
|
|
|
|
<li><a href="./Gitlab/GitoliteConfig.html">Gitlab::GitoliteConfig</a>
|
|
|
|
<li><a href="./Gitlab/GitoliteConfig/PullError.html">Gitlab::GitoliteConfig::PullError</a>
|
|
|
|
<li><a href="./Gitlab/GitoliteConfig/PushError.html">Gitlab::GitoliteConfig::PushError</a>
|
|
|
|
<li><a href="./Gitlab/GraphCommit.html">Gitlab::GraphCommit</a>
|
|
|
|
<li><a href="./Gitlab/InlineDiff.html">Gitlab::InlineDiff</a>
|
|
|
|
<li><a href="./Gitlab/Issues.html">Gitlab::Issues</a>
|
|
|
|
<li><a href="./Gitlab/Logger.html">Gitlab::Logger</a>
|
|
|
|
<li><a href="./Gitlab/Markdown.html">Gitlab::Markdown</a>
|
|
|
|
<li><a href="./Gitlab/Merge.html">Gitlab::Merge</a>
|
|
|
|
<li><a href="./Gitlab/Milestones.html">Gitlab::Milestones</a>
|
|
|
|
<li><a href="./Gitlab/Projects.html">Gitlab::Projects</a>
|
|
|
|
<li><a href="./Gitlab/Satellite.html">Gitlab::Satellite</a>
|
|
|
|
<li><a href="./Gitlab/Session.html">Gitlab::Session</a>
|
|
|
|
<li><a href="./Gitlab/Theme.html">Gitlab::Theme</a>
|
|
|
|
<li><a href="./Gitlab/Users.html">Gitlab::Users</a>
|
|
|
|
<li><a href="./Admin.html">Admin</a>
|
|
|
|
<li><a href="./Admin/DashboardController.html">Admin::DashboardController</a>
|
|
|
|
<li><a href="./Admin/GroupsController.html">Admin::GroupsController</a>
|
|
|
|
<li><a href="./Admin/HooksController.html">Admin::HooksController</a>
|
|
|
|
<li><a href="./Admin/LogsController.html">Admin::LogsController</a>
|
|
|
|
<li><a href="./Admin/ProjectsController.html">Admin::ProjectsController</a>
|
|
|
|
<li><a href="./Admin/ResqueController.html">Admin::ResqueController</a>
|
|
|
|
<li><a href="./Admin/TeamMembersController.html">Admin::TeamMembersController</a>
|
|
|
|
<li><a href="./Admin/UsersController.html">Admin::UsersController</a>
|
|
|
|
<li><a href="./Notes.html">Notes</a>
|
|
|
|
<li><a href="./Notes/CreateContext.html">Notes::CreateContext</a>
|
|
|
|
<li><a href="./Notes/LoadContext.html">Notes::LoadContext</a>
|
|
|
|
<li><a href="./Redcarpet.html">Redcarpet</a>
|
|
|
|
<li><a href="./Redcarpet/Render.html">Redcarpet::Render</a>
|
|
|
|
<li><a href="./Redcarpet/Render/GitlabHTML.html">Redcarpet::Render::GitlabHTML</a>
|
|
|
|
<li><a href="./ExtractsPath.html">ExtractsPath</a>
|
|
|
|
<li><a href="./ExtractsPath/InvalidPathError.html">ExtractsPath::InvalidPathError</a>
|
|
|
|
<li><a href="./FileSizeValidator.html">FileSizeValidator</a>
|
|
|
|
<li><a href="./FileSizeValidator/Helper.html">FileSizeValidator::Helper</a>
|
|
|
|
<li><a href="./Grack.html">Grack</a>
|
|
|
|
<li><a href="./Grack/Auth.html">Grack::Auth</a>
|
|
|
|
<li><a href="./IssueCommonality.html">IssueCommonality</a>
|
|
|
|
<li><a href="./IssueCommonality/ClassMethods.html">IssueCommonality::ClassMethods</a>
|
|
|
|
<li><a href="./StaticModel.html">StaticModel</a>
|
|
|
|
<li><a href="./StaticModel/ClassMethods.html">StaticModel::ClassMethods</a>
|
|
|
|
<li><a href="./Ability.html">Ability</a>
|
|
|
|
<li><a href="./Account.html">Account</a>
|
|
|
|
<li><a href="./ActivityObserver.html">ActivityObserver</a>
|
|
|
|
<li><a href="./AdminController.html">AdminController</a>
|
|
|
|
<li><a href="./ApplicationController.html">ApplicationController</a>
|
|
|
|
<li><a href="./ApplicationDecorator.html">ApplicationDecorator</a>
|
|
|
|
<li><a href="./ApplicationHelper.html">ApplicationHelper</a>
|
|
|
|
<li><a href="./AttachmentUploader.html">AttachmentUploader</a>
|
|
|
|
<li><a href="./Authority.html">Authority</a>
|
|
|
|
<li><a href="./BaseContext.html">BaseContext</a>
|
|
|
|
<li><a href="./BlameController.html">BlameController</a>
|
|
|
|
<li><a href="./BlobController.html">BlobController</a>
|
|
|
|
<li><a href="./Commit.html">Commit</a>
|
|
|
|
<li><a href="./CommitController.html">CommitController</a>
|
|
|
|
<li><a href="./CommitDecorator.html">CommitDecorator</a>
|
|
|
|
<li><a href="./CommitLoadContext.html">CommitLoadContext</a>
|
|
|
|
<li><a href="./CommitsController.html">CommitsController</a>
|
|
|
|
<li><a href="./CommitsHelper.html">CommitsHelper</a>
|
|
|
|
<li><a href="./CompareController.html">CompareController</a>
|
|
|
|
<li><a href="./DashboardController.html">DashboardController</a>
|
|
|
|
<li><a href="./DeployKeysController.html">DeployKeysController</a>
|
|
|
|
<li><a href="./ErrorsController.html">ErrorsController</a>
|
|
|
|
<li><a href="./Event.html">Event</a>
|
|
|
|
<li><a href="./EventDecorator.html">EventDecorator</a>
|
|
|
|
<li><a href="./EventsHelper.html">EventsHelper</a>
|
|
|
|
<li><a href="./GitHost.html">GitHost</a>
|
|
|
|
<li><a href="./GitlabMarkdownHelper.html">GitlabMarkdownHelper</a>
|
|
|
|
<li><a href="./Group.html">Group</a>
|
|
|
|
<li><a href="./GroupsController.html">GroupsController</a>
|
|
|
|
<li><a href="./HelpController.html">HelpController</a>
|
|
|
|
<li><a href="./HooksController.html">HooksController</a>
|
|
|
|
<li><a href="./Issue.html">Issue</a>
|
|
|
|
<li><a href="./IssueObserver.html">IssueObserver</a>
|
|
|
|
<li><a href="./IssuesBulkUpdateContext.html">IssuesBulkUpdateContext</a>
|
|
|
|
<li><a href="./IssuesController.html">IssuesController</a>
|
|
|
|
<li><a href="./IssuesHelper.html">IssuesHelper</a>
|
|
|
|
<li><a href="./IssuesListContext.html">IssuesListContext</a>
|
|
|
|
<li><a href="./Key.html">Key</a>
|
|
|
|
<li><a href="./KeyObserver.html">KeyObserver</a>
|
|
|
|
<li><a href="./KeysController.html">KeysController</a>
|
|
|
|
<li><a href="./LabelsController.html">LabelsController</a>
|
|
|
|
<li><a href="./MergeRequest.html">MergeRequest</a>
|
|
|
|
<li><a href="./MergeRequestObserver.html">MergeRequestObserver</a>
|
|
|
|
<li><a href="./MergeRequestsController.html">MergeRequestsController</a>
|
|
|
|
<li><a href="./MergeRequestsHelper.html">MergeRequestsHelper</a>
|
|
|
|
<li><a href="./MergeRequestsLoadContext.html">MergeRequestsLoadContext</a>
|
|
|
|
<li><a href="./Milestone.html">Milestone</a>
|
|
|
|
<li><a href="./MilestonesController.html">MilestonesController</a>
|
|
|
|
<li><a href="./Note.html">Note</a>
|
|
|
|
<li><a href="./NoteObserver.html">NoteObserver</a>
|
|
|
|
<li><a href="./NotesController.html">NotesController</a>
|
|
|
|
<li><a href="./NotesHelper.html">NotesHelper</a>
|
|
|
|
<li><a href="./Notify.html">Notify</a>
|
|
|
|
<li><a href="./OmniauthCallbacksController.html">OmniauthCallbacksController</a>
|
|
|
|
<li><a href="./PostReceive.html">PostReceive</a>
|
|
|
|
<li><a href="./ProfileController.html">ProfileController</a>
|
|
|
|
<li><a href="./ProfileHelper.html">ProfileHelper</a>
|
|
|
|
<li><a href="./Project.html">Project</a>
|
|
|
|
<li><a href="./ProjectHook.html">ProjectHook</a>
|
|
|
|
<li><a href="./ProjectObserver.html">ProjectObserver</a>
|
|
|
|
<li><a href="./ProjectResourceController.html">ProjectResourceController</a>
|
|
|
|
<li><a href="./ProjectsController.html">ProjectsController</a>
|
|
|
|
<li><a href="./ProjectsHelper.html">ProjectsHelper</a>
|
|
|
|
<li><a href="./ProtectedBranch.html">ProtectedBranch</a>
|
|
|
|
<li><a href="./ProtectedBranchesController.html">ProtectedBranchesController</a>
|
|
|
|
<li><a href="./PushEvent.html">PushEvent</a>
|
|
|
|
<li><a href="./PushObserver.html">PushObserver</a>
|
|
|
|
<li><a href="./RefsController.html">RefsController</a>
|
|
|
|
<li><a href="./RepositoriesController.html">RepositoriesController</a>
|
|
|
|
<li><a href="./Repository.html">Repository</a>
|
|
|
|
<li><a href="./SearchContext.html">SearchContext</a>
|
|
|
|
<li><a href="./SearchController.html">SearchController</a>
|
|
|
|
<li><a href="./Snippet.html">Snippet</a>
|
|
|
|
<li><a href="./SnippetsController.html">SnippetsController</a>
|
|
|
|
<li><a href="./SnippetsHelper.html">SnippetsHelper</a>
|
|
|
|
<li><a href="./SystemHook.html">SystemHook</a>
|
|
|
|
<li><a href="./SystemHookObserver.html">SystemHookObserver</a>
|
|
|
|
<li><a href="./SystemHookWorker.html">SystemHookWorker</a>
|
|
|
|
<li><a href="./TabHelper.html">TabHelper</a>
|
|
|
|
<li><a href="./TagsHelper.html">TagsHelper</a>
|
|
|
|
<li><a href="./Team.html">Team</a>
|
|
|
|
<li><a href="./TeamMembersController.html">TeamMembersController</a>
|
|
|
|
<li><a href="./TestHookContext.html">TestHookContext</a>
|
|
|
|
<li><a href="./Tree.html">Tree</a>
|
|
|
|
<li><a href="./TreeController.html">TreeController</a>
|
|
|
|
<li><a href="./TreeDecorator.html">TreeDecorator</a>
|
|
|
|
<li><a href="./TreeHelper.html">TreeHelper</a>
|
|
|
|
<li><a href="./User.html">User</a>
|
|
|
|
<li><a href="./UserObserver.html">UserObserver</a>
|
|
|
|
<li><a href="./UsersProject.html">UsersProject</a>
|
|
|
|
<li><a href="./UsersProjectObserver.html">UsersProjectObserver</a>
|
|
|
|
<li><a href="./Votes.html">Votes</a>
|
|
|
|
<li><a href="./WebHook.html">WebHook</a>
|
|
|
|
<li><a href="./Wiki.html">Wiki</a>
|
|
|
|
<li><a href="./WikisController.html">WikisController</a>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</div>
|
|
</nav>
|
|
|
|
<div id="documentation">
|
|
<h1 class="class">class Project</h1>
|
|
|
|
<div id="description" class="description">
|
|
|
|
</div><!-- description -->
|
|
|
|
|
|
|
|
|
|
<section id="5Buntitled-5D" class="documentation-section">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Attributes -->
|
|
<section id="attribute-method-details" class="method-section section">
|
|
<h3 class="section-header">Attributes</h3>
|
|
|
|
|
|
<div id="attribute-i-error_code" class="method-detail">
|
|
<div class="method-heading attribute-method-heading">
|
|
<span class="method-name">error_code</span><span
|
|
class="attribute-access-type">[RW]</span>
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</section><!-- attribute-method-details -->
|
|
|
|
|
|
<!-- Methods -->
|
|
|
|
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
|
<h3 class="section-header">Public Class Methods</h3>
|
|
|
|
|
|
<div id="method-c-access_options" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">access_options</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="access_options-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 85</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">access_options</span>
|
|
<span class="ruby-constant">UsersProject</span>.<span class="ruby-identifier">access_roles</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- access_options-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- access_options-method -->
|
|
|
|
|
|
<div id="method-c-active" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">active</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="active-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 52</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">active</span>
|
|
<span class="ruby-identifier">joins</span>(<span class="ruby-value">:issues</span>, <span class="ruby-value">:notes</span>, <span class="ruby-value">:merge_requests</span>).<span class="ruby-identifier">order</span>(<span class="ruby-string">"issues.created_at, notes.created_at, merge_requests.created_at DESC"</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- active-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- active-method -->
|
|
|
|
|
|
<div id="method-c-create_by_user" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">create_by_user</span><span
|
|
class="method-args">(params, user)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="create_by_user-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 60</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_by_user</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">user</span>)
|
|
<span class="ruby-identifier">project</span> = <span class="ruby-constant">Project</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">params</span>
|
|
|
|
<span class="ruby-constant">Project</span>.<span class="ruby-identifier">transaction</span> <span class="ruby-keyword">do</span>
|
|
<span class="ruby-identifier">project</span>.<span class="ruby-identifier">owner</span> = <span class="ruby-identifier">user</span>
|
|
<span class="ruby-identifier">project</span>.<span class="ruby-identifier">save!</span>
|
|
|
|
<span class="ruby-comment"># Add user as project master</span>
|
|
<span class="ruby-identifier">project</span>.<span class="ruby-identifier">users_projects</span>.<span class="ruby-identifier">create!</span>(<span class="ruby-identifier">project_access</span><span class="ruby-operator">:</span> <span class="ruby-constant">UsersProject</span><span class="ruby-operator">::</span><span class="ruby-constant">MASTER</span>, <span class="ruby-identifier">user</span><span class="ruby-operator">:</span> <span class="ruby-identifier">user</span>)
|
|
|
|
<span class="ruby-comment"># when project saved no team member exist so</span>
|
|
<span class="ruby-comment"># project repository should be updated after first user add</span>
|
|
<span class="ruby-identifier">project</span>.<span class="ruby-identifier">update_repository</span>
|
|
<span class="ruby-keyword">end</span>
|
|
|
|
<span class="ruby-identifier">project</span>
|
|
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Gitlab</span><span class="ruby-operator">::</span><span class="ruby-constant">Gitolite</span><span class="ruby-operator">::</span><span class="ruby-constant">AccessDenied</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">ex</span>
|
|
<span class="ruby-identifier">project</span>.<span class="ruby-identifier">error_code</span> = <span class="ruby-value">:gitolite</span>
|
|
<span class="ruby-identifier">project</span>
|
|
<span class="ruby-keyword">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">ex</span>
|
|
<span class="ruby-identifier">project</span>.<span class="ruby-identifier">error_code</span> = <span class="ruby-value">:db</span>
|
|
<span class="ruby-identifier">project</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">add</span>(<span class="ruby-value">:base</span>, <span class="ruby-string">"Can't save project. Please try again later"</span>)
|
|
<span class="ruby-identifier">project</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- create_by_user-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- create_by_user-method -->
|
|
|
|
|
|
<div id="method-c-search" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">search</span><span
|
|
class="method-args">(query)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="search-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 56</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">search</span> <span class="ruby-identifier">query</span>
|
|
<span class="ruby-identifier">where</span>(<span class="ruby-string">"name LIKE :query OR code LIKE :query OR path LIKE :query"</span>, <span class="ruby-identifier">query</span><span class="ruby-operator">:</span> <span class="ruby-node">"%#{query}%"</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- search-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- search-method -->
|
|
|
|
|
|
</section><!-- public-class-method-details -->
|
|
|
|
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
|
<h3 class="section-header">Public Instance Methods</h3>
|
|
|
|
|
|
<div id="method-i-build_commit_note" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">build_commit_note</span><span
|
|
class="method-args">(commit)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="build_commit_note-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 124</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">build_commit_note</span>(<span class="ruby-identifier">commit</span>)
|
|
<span class="ruby-identifier">notes</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">noteable_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">commit</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">noteable_type</span><span class="ruby-operator">:</span> <span class="ruby-string">"Commit"</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- build_commit_note-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- build_commit_note-method -->
|
|
|
|
|
|
<div id="method-i-check_limit" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">check_limit</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="check_limit-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 98</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">check_limit</span>
|
|
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">owner</span>.<span class="ruby-identifier">can_create_project?</span>
|
|
<span class="ruby-identifier">errors</span>[<span class="ruby-value">:base</span>] <span class="ruby-operator"><<</span> (<span class="ruby-node">"Your own projects limit is #{owner.projects_limit}! Please contact administrator to increase it"</span>)
|
|
<span class="ruby-keyword">end</span>
|
|
<span class="ruby-keyword">rescue</span>
|
|
<span class="ruby-identifier">errors</span>[<span class="ruby-value">:base</span>] <span class="ruby-operator"><<</span> (<span class="ruby-string">"Can't check your ability to create project"</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- check_limit-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- check_limit-method -->
|
|
|
|
|
|
<div id="method-i-commit_line_notes" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">commit_line_notes</span><span
|
|
class="method-args">(commit)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="commit_line_notes-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 132</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">commit_line_notes</span>(<span class="ruby-identifier">commit</span>)
|
|
<span class="ruby-identifier">notes</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">noteable_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">commit</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">noteable_type</span><span class="ruby-operator">:</span> <span class="ruby-string">"Commit"</span>).<span class="ruby-identifier">where</span>(<span class="ruby-string">"line_code IS NOT NULL"</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- commit_line_notes-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- commit_line_notes-method -->
|
|
|
|
|
|
<div id="method-i-commit_notes" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">commit_notes</span><span
|
|
class="method-args">(commit)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="commit_notes-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 128</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">commit_notes</span>(<span class="ruby-identifier">commit</span>)
|
|
<span class="ruby-identifier">notes</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">noteable_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">commit</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">noteable_type</span><span class="ruby-operator">:</span> <span class="ruby-string">"Commit"</span>, <span class="ruby-identifier">line_code</span><span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- commit_notes-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- commit_notes-method -->
|
|
|
|
|
|
<div id="method-i-common_notes" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">common_notes</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="common_notes-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 120</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">common_notes</span>
|
|
<span class="ruby-identifier">notes</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">noteable_type</span><span class="ruby-operator">:</span> [<span class="ruby-string">""</span>, <span class="ruby-keyword">nil</span>]).<span class="ruby-identifier">inc_author_project</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- common_notes-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- common_notes-method -->
|
|
|
|
|
|
<div id="method-i-git_error-3F" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">git_error?</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="git_error-3F-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 90</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">git_error?</span>
|
|
<span class="ruby-identifier">error_code</span> <span class="ruby-operator">==</span> <span class="ruby-value">:gitolite</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- git_error-3F-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- git_error-3F-method -->
|
|
|
|
|
|
<div id="method-i-issues_labels" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">issues_labels</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="issues_labels-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 160</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">issues_labels</span>
|
|
<span class="ruby-identifier">issues</span>.<span class="ruby-identifier">tag_counts_on</span>(<span class="ruby-value">:labels</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- issues_labels-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- issues_labels-method -->
|
|
|
|
|
|
<div id="method-i-last_activity" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">last_activity</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="last_activity-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 144</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">last_activity</span>
|
|
<span class="ruby-identifier">last_event</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- last_activity-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- last_activity-method -->
|
|
|
|
|
|
<div id="method-i-last_activity_date" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">last_activity_date</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="last_activity_date-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 148</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">last_activity_date</span>
|
|
<span class="ruby-identifier">last_event</span>.<span class="ruby-identifier">try</span>(<span class="ruby-value">:created_at</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">updated_at</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- last_activity_date-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- last_activity_date-method -->
|
|
|
|
|
|
<div id="method-i-private-3F" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">private?</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="private-3F-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 140</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">private?</span>
|
|
<span class="ruby-identifier">private_flag</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- private-3F-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- private-3F-method -->
|
|
|
|
|
|
<div id="method-i-project_id" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">project_id</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="project_id-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 156</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">project_id</span>
|
|
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- project_id-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- project_id-method -->
|
|
|
|
|
|
<div id="method-i-public-3F" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">public?</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="public-3F-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 136</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">public?</span>
|
|
<span class="ruby-operator">!</span><span class="ruby-identifier">private_flag</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- public-3F-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- public-3F-method -->
|
|
|
|
|
|
<div id="method-i-repo_name" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">repo_name</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="repo_name-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 106</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">repo_name</span>
|
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-string">"gitolite-admin"</span>
|
|
<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">add</span>(<span class="ruby-value">:path</span>, <span class="ruby-string">" like 'gitolite-admin' is not allowed"</span>)
|
|
<span class="ruby-keyword">end</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- repo_name-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- repo_name-method -->
|
|
|
|
|
|
<div id="method-i-saved-3F" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">saved?</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="saved-3F-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 94</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">saved?</span>
|
|
<span class="ruby-identifier">id</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">valid?</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- saved-3F-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- saved-3F-method -->
|
|
|
|
|
|
<div id="method-i-to_param" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">to_param</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="to_param-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 112</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_param</span>
|
|
<span class="ruby-identifier">code</span>
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- to_param-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- to_param-method -->
|
|
|
|
|
|
<div id="method-i-web_url" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">web_url</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="web_url-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 116</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">web_url</span>
|
|
[<span class="ruby-constant">Gitlab</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">url</span>, <span class="ruby-identifier">code</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">"/"</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- web_url-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- web_url-method -->
|
|
|
|
|
|
<div id="method-i-wiki_notes" class="method-detail ">
|
|
|
|
<div class="method-heading">
|
|
<span class="method-name">wiki_notes</span><span
|
|
class="method-args">()</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
</div>
|
|
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code" id="wiki_notes-source">
|
|
<pre><span class="ruby-comment"># File app/models/project.rb, line 152</span>
|
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">wiki_notes</span>
|
|
<span class="ruby-constant">Note</span>.<span class="ruby-identifier">where</span>(<span class="ruby-identifier">noteable_id</span><span class="ruby-operator">:</span> <span class="ruby-identifier">wikis</span>.<span class="ruby-identifier">pluck</span>(<span class="ruby-value">:id</span>), <span class="ruby-identifier">noteable_type</span><span class="ruby-operator">:</span> <span class="ruby-string">'Wiki'</span>, <span class="ruby-identifier">project_id</span><span class="ruby-operator">:</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>)
|
|
<span class="ruby-keyword">end</span></pre>
|
|
</div><!-- wiki_notes-source -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div><!-- wiki_notes-method -->
|
|
|
|
|
|
</section><!-- public-instance-method-details -->
|
|
|
|
</section><!-- 5Buntitled-5D -->
|
|
|
|
</div><!-- documentation -->
|
|
|
|
|
|
<footer id="validator-badges">
|
|
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
|
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
</footer>
|
|
|