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
ff0670d9
Commit
ff0670d9
authored
9 years ago
by
Mauricio Giacomini Girardello
Browse files
Options
Downloads
Patches
Plain Diff
using AttributeBuilder class
parent
57e27451
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/repositories/active_record/carousel_repository.rb
+0
-1
0 additions, 1 deletion
app/repositories/active_record/carousel_repository.rb
app/repositories/orient_db/attribute_repository.rb
+3
-13
3 additions, 13 deletions
app/repositories/orient_db/attribute_repository.rb
with
3 additions
and
14 deletions
app/repositories/active_record/carousel_repository.rb
+
0
−
1
View file @
ff0670d9
...
@@ -14,7 +14,6 @@ class ActiveRecord::CarouselRepository
...
@@ -14,7 +14,6 @@ class ActiveRecord::CarouselRepository
Carousel
.
send
(
method_name
,
*
arguments
,
&
block
)
Carousel
.
send
(
method_name
,
*
arguments
,
&
block
)
end
end
def
respond_to?
(
method_name
,
include_private
=
false
)
def
respond_to?
(
method_name
,
include_private
=
false
)
Carousel
.
respond_to?
(
method_name
)
||
super
Carousel
.
respond_to?
(
method_name
)
||
super
end
end
...
...
This diff is collapsed.
Click to expand it.
app/repositories/orient_db/attribute_repository.rb
+
3
−
13
View file @
ff0670d9
module
OrientDb
module
OrientDb
class
AttributeRepository
<
Base
class
AttributeRepository
<
Base
def
find_by_key_and_value
(
key
,
value
)
def
find_by_key_and_value
(
key
,
value
)
# Escape double quotes for OrientDB
# Escape double quotes for OrientDB
v
=
value
.
gsub
(
'"'
,
'\\"'
)
v
=
value
.
gsub
(
'"'
,
'\\"'
)
result
=
connection
.
query
(
"SELECT EXPAND(rid) FROM INDEX:attr_unique WHERE key = [
\"
#{
key
}
\"
,
\"
#{
v
}
\"
]"
)
result
=
connection
.
query
(
"SELECT EXPAND(rid) FROM INDEX:attr_unique WHERE key = [
\"
#{
key
}
\"
,
\"
#{
v
}
\"
]"
)
build_object
(
result
.
first
)
build_object
(
result
.
first
)
end
end
...
@@ -13,17 +13,7 @@ module OrientDb
...
@@ -13,17 +13,7 @@ module OrientDb
end
end
def
build_object
(
args
=
{})
def
build_object
(
args
=
{})
attribute
=
nil
AttributeBuilder
.
build_from_orientdb
args
unless
args
.
nil?
attribute
=
Attribute
.
new
(
:id
=>
args
[
"@rid"
])
args
.
each
do
|
var
,
val
|
var_name
=
"@"
+
var
if
attribute
.
respond_to?
(
var
)
attribute
.
instance_variable_set
(
var_name
,
val
)
end
end
end
attribute
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