lib/intercom.rb in intercom-0.0.4 vs lib/intercom.rb in intercom-0.0.5
- old
+ new
@@ -65,10 +65,10 @@
raise ArgumentError.new("Expected params Hash, got #{params.class}") unless params.is_a?(Hash)
raise ArgumentError.new("Either email or user_id must be specified") unless params.keys.any? { |key| %W(email user_id).include?(key.to_s) }
end
def self.execute_request(method, path, params = {}, headers = {}, payload = nil)
- method.eql?(:get) ? require_email_or_user_id(params) : require_email_or_user_id(payload)
+ method.eql?(:get) ? require_email_or_user_id(params) : require_email_or_user_id(payload) unless path.eql?("users")
args =rest_client_args(method, path, params, headers, payload)
begin
response = RestClient::Request.execute(args)
JSON.parse(response.body)
rescue RestClient::ResourceNotFound
\ No newline at end of file