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
5c743429
Commit
5c743429
authored
9 years ago
by
Bruno Nocera Zanette
Browse files
Options
Downloads
Patches
Plain Diff
Refactor code to use Repository::Base Methods
parent
b02fe31e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/repositories/orient_db/learning_object_repository.rb
+0
-10
0 additions, 10 deletions
app/repositories/orient_db/learning_object_repository.rb
lib/tasks/fakeData.rake
+1
-1
1 addition, 1 deletion
lib/tasks/fakeData.rake
lib/tasks/thumbnail.rake
+1
-1
1 addition, 1 deletion
lib/tasks/thumbnail.rake
with
2 additions
and
12 deletions
app/repositories/orient_db/learning_object_repository.rb
+
0
−
10
View file @
5c743429
...
@@ -15,16 +15,6 @@ module OrientDb
...
@@ -15,16 +15,6 @@ module OrientDb
create_edge
"Likes"
,
user
.
rid
,
learning_object
.
id
create_edge
"Likes"
,
user
.
rid
,
learning_object
.
id
end
end
# Example:
# list = repository.for(:learning_objects).all
# list.each do |learning_object|
# learning_object.inspect <LearningObject model>
# end
def
all
(
limit
=
100
,
offset
=
0
)
learning_objects_hash
=
connection
.
query
"SELECT FROM LearningObject LIMIT
#{
limit
}
OFFSET
#{
offset
}
"
,
{
limit:
limit
}
build_objects
(
learning_objects_hash
)
||
[]
end
# Usage:
# Usage:
# learning_object = repository.for(:learning_objects).get_by_dspace_id 123
# learning_object = repository.for(:learning_objects).get_by_dspace_id 123
#
#
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/fakeData.rake
+
1
−
1
View file @
5c743429
...
@@ -36,7 +36,7 @@ namespace :fakedata do
...
@@ -36,7 +36,7 @@ namespace :fakedata do
begin
begin
# Get items from dspace (from offset to offset+limit)
# Get items from dspace (from offset to offset+limit)
learning_objects
=
learning_object_repository
.
all
(
limit
,
offset
)
learning_objects
=
learning_object_repository
.
all
_from_offset_to_limit
(
limit
,
offset
)
rescue
rescue
# Sleeps for a while to wait database's recovery
# Sleeps for a while to wait database's recovery
sleep
(
30
.
seconds
)
sleep
(
30
.
seconds
)
...
...
This diff is collapsed.
Click to expand it.
lib/tasks/thumbnail.rake
+
1
−
1
View file @
5c743429
...
@@ -15,7 +15,7 @@ namespace :thumbnail do
...
@@ -15,7 +15,7 @@ namespace :thumbnail do
begin
begin
# Get items from dspace (from offset to offset+limit)
# Get items from dspace (from offset to offset+limit)
items
=
learning_object_repository
.
all
(
limit
,
offset
)
items
=
learning_object_repository
.
all
_from_offset_to_limit
(
limit
,
offset
)
rescue
rescue
# Sleeps for a while to wait database's recovery
# Sleeps for a while to wait database's recovery
sleep
(
30
.
seconds
)
sleep
(
30
.
seconds
)
...
...
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