Commit 563940ba authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'docs-update-empty-arguments' into 'master'

Fix empty arguments in the cheat sheet

See merge request gitlab-org/gitlab!58750
parents 08022572 7029cd77
...@@ -215,8 +215,8 @@ project = Project.find_by_full_path('group-changeme/project-changeme') ...@@ -215,8 +215,8 @@ project = Project.find_by_full_path('group-changeme/project-changeme')
### Destroy a project ### Destroy a project
```ruby ```ruby
project = Project.find_by_full_path('') project = Project.find_by_full_path('<project_path>')
user = User.find_by_username('') user = User.find_by_username('<username>')
ProjectDestroyWorker.perform_async(project.id, user.id, {}) ProjectDestroyWorker.perform_async(project.id, user.id, {})
# or ProjectDestroyWorker.new.perform(project.id, user.id, {}) # or ProjectDestroyWorker.new.perform(project.id, user.id, {})
# or Projects::DestroyService.new(project, user).execute # or Projects::DestroyService.new(project, user).execute
...@@ -225,8 +225,8 @@ ProjectDestroyWorker.perform_async(project.id, user.id, {}) ...@@ -225,8 +225,8 @@ ProjectDestroyWorker.perform_async(project.id, user.id, {})
### Remove fork relationship manually ### Remove fork relationship manually
```ruby ```ruby
p = Project.find_by_full_path('') p = Project.find_by_full_path('<project_path>')
u = User.find_by_username('') u = User.find_by_username('<username>')
::Projects::UnlinkForkService.new(p, u).execute ::Projects::UnlinkForkService.new(p, u).execute
``` ```
...@@ -243,13 +243,13 @@ project.update!(repository_read_only: true) ...@@ -243,13 +243,13 @@ project.update!(repository_read_only: true)
### Transfer project from one namespace to another ### Transfer project from one namespace to another
```ruby ```ruby
p= Project.find_by_full_path('') p= Project.find_by_full_path('<project_path>')
# To set the owner of the project # To set the owner of the project
current_user= p.creator current_user= p.creator
# Namespace where you want this to be moved. # Namespace where you want this to be moved.
namespace = Namespace.find_by_full_path("") namespace = Namespace.find_by_full_path("<new_namespace>")
::Projects::TransferService.new(p, current_user).execute(namespace) ::Projects::TransferService.new(p, current_user).execute(namespace)
``` ```
...@@ -468,7 +468,7 @@ end ...@@ -468,7 +468,7 @@ end
### Skip reconfirmation ### Skip reconfirmation
```ruby ```ruby
user = User.find_by_username '' user = User.find_by_username '<username>'
user.skip_reconfirmation! user.skip_reconfirmation!
``` ```
...@@ -558,7 +558,7 @@ user.max_member_access_for_group group.id ...@@ -558,7 +558,7 @@ user.max_member_access_for_group group.id
```ruby ```ruby
user = User.find_by_username('<username>') user = User.find_by_username('<username>')
group = Group.find_by_name("<group_name>") group = Group.find_by_name("<group_name>")
parent_group = Group.find_by(id: "") # empty string amounts to root as parent parent_group = Group.find_by(id: "<group_id>")
service = ::Groups::TransferService.new(group, user) service = ::Groups::TransferService.new(group, user)
service.execute(parent_group) service.execute(parent_group)
``` ```
...@@ -679,7 +679,7 @@ conflicting_permanent_redirects.destroy_all ...@@ -679,7 +679,7 @@ conflicting_permanent_redirects.destroy_all
```ruby ```ruby
p = Project.find_by_full_path('<full/path/to/project>') p = Project.find_by_full_path('<full/path/to/project>')
m = p.merge_requests.find_by(iid: <iid>) m = p.merge_requests.find_by(iid: <iid>)
u = User.find_by_username('') u = User.find_by_username('<username>')
MergeRequests::PostMergeService.new(p, u).execute(m) MergeRequests::PostMergeService.new(p, u).execute(m)
``` ```
...@@ -695,9 +695,9 @@ Issuable::DestroyService.new(m.project, u).execute(m) ...@@ -695,9 +695,9 @@ Issuable::DestroyService.new(m.project, u).execute(m)
### Rebase manually ### Rebase manually
```ruby ```ruby
p = Project.find_by_full_path('') p = Project.find_by_full_path('<project_path>')
m = project.merge_requests.find_by(iid: ) m = project.merge_requests.find_by(iid: )
u = User.find_by_username('') u = User.find_by_username('<username>')
MergeRequests::RebaseService.new(m.target_project, u).execute(m) MergeRequests::RebaseService.new(m.target_project, u).execute(m)
``` ```
...@@ -734,7 +734,7 @@ build.dependencies.each do |d| { puts "status: #{d.status}, finished at: #{d.fin ...@@ -734,7 +734,7 @@ build.dependencies.each do |d| { puts "status: #{d.status}, finished at: #{d.fin
### Try CI service ### Try CI service
```ruby ```ruby
p = Project.find_by_full_path('') p = Project.find_by_full_path('<project_path>')
m = project.merge_requests.find_by(iid: ) m = project.merge_requests.find_by(iid: )
m.project.try(:ci_service) m.project.try(:ci_service)
``` ```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment