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
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
e5426032
Commit
e5426032
authored
9 years ago
by
Lucas Ernesto Kindinger
Browse files
Options
Downloads
Patches
Plain Diff
Fix download Edge creation
Signed-off-by:
Lucas Ernesto Kindinger
<
kindingerlek@hotmail.com
>
parent
d79a8ff4
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
app/repositories/orient_db/learning_object_repository.rb
+3
-6
3 additions, 6 deletions
app/repositories/orient_db/learning_object_repository.rb
with
3 additions
and
6 deletions
app/repositories/orient_db/learning_object_repository.rb
+
3
−
6
View file @
e5426032
...
...
@@ -13,8 +13,6 @@ module OrientDb
def
increment_views
(
user
,
learning_object
)
values
=
{
date:
sanitize_orientdb_values
(
Time
.
now
)}
puts
"
\n\n\n\n\n\n
>>>>>>>>>>>>>>>>>>>>>>"
# If doesn't exist edges from user and learning object, create it and increment attribute
if
!
edge_exists?
"Views"
,
user
.
rid
,
learning_object
.
id
create_and_set_edge
"Views"
,
user
.
rid
,
learning_object
.
id
,
values
...
...
@@ -27,14 +25,13 @@ module OrientDb
puts
edge
set_values_edge
edge
[
"@rid"
],
values
end
puts
"
\n\n\n\n\n\n\n\n\n\n\n\n\n
"
end
def
download
(
user
,
learning_object
)
download_edge_class
=
'Downloads'
values
=
{
date:
sanitize_orientdb_values
(
Time
.
now
)}
create_and_set_edge
like
_edge_class
,
user
.
rid
,
learning_object
.
id
,
values
create_and_set_edge
download
_edge_class
,
user
.
rid
,
learning_object
.
id
,
values
learning_object
.
downloads
=
learning_object
.
downloads
+
1
end
...
...
@@ -59,7 +56,7 @@ module OrientDb
# If not liked, like and set date
if
!
liked?
user
,
learning_object
# The properties of edge. In this case, only date for edge 'Likes'
values
=
{
date:
Time
.
now
}
values
=
{
date:
sanitize_orientdb_values
(
Time
.
now
)
}
create_and_set_edge
like_edge_class
,
user
.
rid
,
learning_object
.
id
,
values
learning_object
.
likes
=
learning_object
.
likes
+
1
...
...
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