Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
b2454252
Unverified
Commit
b2454252
authored
1 year ago
by
Sébastien Gaya
Browse files
Options
Downloads
Patches
Plain Diff
jobify migration
parent
cb391754
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/jobs/migrate_website_connections_job.rb
+16
-0
16 additions, 0 deletions
app/jobs/migrate_website_connections_job.rb
lib/tasks/app.rake
+1
-10
1 addition, 10 deletions
lib/tasks/app.rake
with
17 additions
and
10 deletions
app/jobs/migrate_website_connections_job.rb
0 → 100644
+
16
−
0
View file @
b2454252
class
MigrateWebsiteConnectionsJob
<
ApplicationJob
queue_as
:default
def
perform
(
website_id
)
website
=
Communication
::
Website
.
find
(
website_id
)
website
.
pages
.
find_each
(
&
:connect_dependencies
)
website
.
posts
.
find_each
(
&
:connect_dependencies
)
website
.
categories
.
find_each
(
&
:connect_dependencies
)
website
.
menus
.
find_each
(
&
:connect_dependencies
)
website
.
connect
(
website
.
about
,
website
)
if
website
.
about
.
present?
website
.
destroy_obsolete_connections
website
.
sync_with_git
website
.
destroy_obsolete_git_files
end
end
This diff is collapsed.
Click to expand it.
lib/tasks/app.rake
+
1
−
10
View file @
b2454252
...
...
@@ -9,16 +9,7 @@ namespace :app do
desc
'Fix things'
task
fix: :environment
do
Communication
::
Website
.
find_each
do
|
website
|
# Rebuild connections
website
.
pages
.
find_each
(
&
:connect_dependencies
)
website
.
posts
.
find_each
(
&
:connect_dependencies
)
website
.
categories
.
find_each
(
&
:connect_dependencies
)
website
.
menus
.
find_each
(
&
:connect_dependencies
)
website
.
connect
(
website
.
about
,
website
)
if
website
.
about
.
present?
website
.
destroy_obsolete_connections
website
.
sync_with_git
website
.
destroy_obsolete_git_files
MigrateWebsiteConnectionsJob
.
perform_later
(
website
.
id
)
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment