We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Connector::fetch_existing_attribute
1 parent 0ac97a2 commit 32ed9b8Copy full SHA for 32ed9b8
lib/enmeshed/connector.rb
@@ -28,9 +28,11 @@ def create_attribute(attribute)
28
# @return [String, nil] The ID of the existing attribute or nil if none was found.
29
def fetch_existing_attribute(attribute)
30
response = connection.get('/api/v2/Attributes') do |request|
31
- request.params['content.@type'] = attribute.klass
32
- request.params['content.owner'] = attribute.owner
33
- request.params['content.value.@type'] = attribute.type
+ request.params.tap do |p|
+ p['content.@type'] = attribute.klass
+ p['content.owner'] = attribute.owner
34
+ p['content.value.@type'] = attribute.type
35
+ end
36
end
37
parse_result(response, Attribute).find {|attr| attr.value == attribute.value }&.id
38
0 commit comments