Skip to content

Commit

Permalink
Use :words_connector instead of connector in RequiresParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Fauser committed Mar 27, 2009
1 parent d89662c commit b3f9ab2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Use :words_connector instead of connector in RequiresParameters [cody]
* Fix extra slash in UPS endpoints [cody]
* Add name to Shipwire class [cody]
* Improve FedEx handling of some error conditions [cody]
Expand Down
2 changes: 1 addition & 1 deletion lib/active_shipping/lib/requires_parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def requires!(hash, *params)
raise ArgumentError.new("Missing required parameter: #{param.first}") unless hash.has_key?(param.first)

valid_options = param[1..-1]
raise ArgumentError.new("Parameter: #{param.first} must be one of #{valid_options.to_sentence(:connector => 'or')}") unless valid_options.include?(hash[param.first])
raise ArgumentError.new("Parameter: #{param.first} must be one of #{valid_options.to_sentence(:words_connector => 'or')}") unless valid_options.include?(hash[param.first])
else
raise ArgumentError.new("Missing required parameter: #{param}") unless hash.has_key?(param)
end
Expand Down

0 comments on commit b3f9ab2

Please sign in to comment.