Skip to content
Browse files

Merge pull request #15 from nuams/master

Another modification to support Redmine REST API
  • Loading branch information...
2 parents aeccf2f + 0a25e2c commit 474537916d118277f0e7aa83ad62fd65b9953133 @jbroadway committed
Showing with 6 additions and 5 deletions.
  1. +6 −5 ActiveResource.php
View
11 ActiveResource.php
@@ -233,14 +233,15 @@ function find ($id = false, $options = array ()) {
if (! $id) {
$id = $this->_data['id'];
}
+ $options_string = '';
+ if (count($options) > 0) {
+ $options_string = '?' . http_build_query ($options);
+ }
if ($id == 'all') {
$url = $this->site . $this->element_name_plural . '.xml';
- if (count ($options) > 0) {
- $url .= '?' . http_build_query ($options);
- }
- return $this->_send_and_receive ($url, 'GET');
+ return $this->_send_and_receive ($url . $options_string, 'GET');
}
- return $this->_send_and_receive ($this->site . $this->element_name_plural . '/' . $id . '.xml', 'GET');
+ return $this->_send_and_receive ($this->site . $this->element_name_plural . '/' . $id . '.xml' . $options_string, 'GET');
}
/**

0 comments on commit 4745379

Please sign in to comment.
Something went wrong with that request. Please try again.