Skip to content

Commit

Permalink
Resource action data param fix.
Browse files Browse the repository at this point in the history
Fixes #893
  • Loading branch information
trevorrowe committed Aug 7, 2015
1 parent ee82c80 commit 70d36a6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Unreleased Changes
------------------

* Issue - Resources - Resolved an issue with resource actions that source
request parameters from data members.

See [related GitHub issue #893](https://github.com/aws/aws-sdk-ruby/issues/893).

2.1.13 (2015-08-06)
------------------

Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-resources/lib/aws-sdk-resources/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def identifier_request_param(definition)
def data_request_param(definition)
RequestParams::DataMember.new({
target: underscore(definition['target']),
value: underscore(definition['path']),
path: underscore(definition['path']),
})
end

Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-resources/lib/aws-sdk-resources/request_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class DataMember
include Param

def initialize(options)
@path = options[:data_path]
@path = options[:path]
super
end

Expand Down
2 changes: 1 addition & 1 deletion aws-sdk-resources/spec/request_params_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module RequestParams
resource = double('resource', data: { member_name: 'johndoe' })
RequestParams::DataMember.new({
target: 'name',
data_path: 'member_name',
path: 'member_name',
}).apply(params, resource:resource)
expect(params).to eq(name:'johndoe')
end
Expand Down

0 comments on commit 70d36a6

Please sign in to comment.