Skip to content

Commit b9317bb

Browse files
committed
Implement comments
1 parent 400584f commit b9317bb

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

lib/optimizely/config/datafile_project_config.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def get_attribute_by_key(attribute_key)
453453
# Returns:
454454
# Attribute corresponding to the provided attribute key.
455455
attribute = @attribute_key_map[attribute_key]
456-
return attribute if @attribute_key_map.key?(attribute_key)
456+
return attribute if attribute
457457

458458
invalid_attribute_error = InvalidAttributeError.new(attribute_key)
459459
@logger.log Logger::ERROR, invalid_attribute_error.message
@@ -470,7 +470,7 @@ def get_attribute_key_by_id(attribute_id)
470470
# Returns:
471471
# Attribute key corresponding to the provided attribute ID.
472472
attribute = @attribute_id_to_key_map[attribute_id]
473-
return attribute if @attribute_id_to_key_map.key?(attribute_id)
473+
return attribute if attribute
474474

475475
invalid_attribute_error = InvalidAttributeError.new(attribute_id)
476476
@logger.log Logger::ERROR, invalid_attribute_error.message

lib/optimizely/helpers/constants.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,12 @@ module Constants
309309
},
310310
'cmab' => {
311311
'type' => 'object',
312-
'items' => {
313-
'type' => 'object',
314-
'properties' => {
315-
'attributeIds' => {
316-
'type' => 'array'
317-
},
318-
'trafficAllocation' => {
319-
'type' => 'integer'
320-
}
312+
'properties' => {
313+
'attributeIds' => {
314+
'type' => 'array'
315+
},
316+
'trafficAllocation' => {
317+
'type' => 'integer'
321318
}
322319
}
323320
}

0 commit comments

Comments
 (0)