Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Harbor 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
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
565ec2d5
Commit
565ec2d5
authored
9 years ago
by
Mateus Rambo Strey
Browse files
Options
Downloads
Patches
Plain Diff
fix mainPage highlights task
parent
7cfae629
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/tasks/mainPage.rake
+8
-7
8 additions, 7 deletions
lib/tasks/mainPage.rake
with
8 additions
and
7 deletions
lib/tasks/mainPage.rake
+
8
−
7
View file @
565ec2d5
namespace
:mainPage
do
namespace
:mainPage
do
desc
"Generate the MainPage"
desc
"Generate the MainPage"
task
:highlights
=>
:environment
do
task
:highlights
=>
:environment
do
repository
=
Portalmec
::
Application
.
repository
include
RepositoriesProxy
# repository = Portalmec::Application.repository
puts
'Generate the main page subject highlights'
puts
'Generate the main page subject highlights'
general_highlights
=
Array
.
new
general_highlights
=
Array
.
new
subjects
=
repository
.
for
(
:subject
).
all
subjects
=
subject_
repository
.
all
subjects
.
each
do
|
subject
|
subjects
.
each
do
|
subject
|
# select all the learning objects about that subject
# select all the learning objects about that subject
objects
=
subject
.
learning_objects
objects
=
subject
.
learning_objects
...
@@ -20,17 +21,17 @@ namespace :mainPage do
...
@@ -20,17 +21,17 @@ namespace :mainPage do
# add the object to the subject highlight
# add the object to the subject highlight
puts
subject
.
name
puts
subject
.
name
repository
.
for
(
:subject
).
update
(
subject
.
id
,
'set'
,
'highlights'
,
'[]'
)
subject_
repository
.
update
(
subject
.
id
,
'set'
,
'highlights'
,
'[]'
)
objects
.
each
do
|
object
|
objects
.
each
do
|
object
|
repository
.
for
(
:subject
).
update
(
subject
.
id
,
'add'
,
'highlights'
,
object
.
name
)
subject_
repository
.
update
(
subject
.
id
,
'add'
,
'highlights'
,
object
.
name
)
end
end
end
end
puts
'Generating the main page highlights'
puts
'Generating the main page highlights'
mainPage
=
repository
.
for
(
:mainPage
)
.
all
.
first
mainPage
=
main_page_
repository
.
all
.
first
rid
=
mainPage
[
'@rid'
]
rid
=
mainPage
[
'@rid'
]
repository
.
for
(
:mainPage
)
.
update
(
rid
,
'set'
,
'highlights'
,
'[]'
)
main_page_
repository
.
update
(
rid
,
'set'
,
'highlights'
,
'[]'
)
general_highlights
.
each
do
|
general_highlight
|
general_highlights
.
each
do
|
general_highlight
|
repository
.
for
(
:mainPage
)
.
update
(
rid
,
'add'
,
'highlights'
,
general_highlight
.
name
)
main_page_
repository
.
update
(
rid
,
'add'
,
'highlights'
,
general_highlight
.
name
)
end
end
end
end
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