-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RestClient::BadRequest in latest commit #174
Comments
Hi Alex. Could it be that you are modifying a view object by setting nil values? Would be great if you could provide some sample code, such as the view definition and example of the view you are building. |
Hi Sam, No, I'm not modifying a view object, and it seems to happen when trying to display all items in any class in my Rails application. Here is an example view definition:
What might be pertinent is that my CouchDB connection has a username and password. |
There is nothing out of the ordinary there Alex. There must be something different in your environment that is not covered by our test cases. Perhaps you could paste the entire model except the bits that do not involve CouchDB? I'm guessing you are doing something like:
and get the error? |
Okay, so I've narrowed this down somewhat. In my controller, I have the following:
This is the corresponding call with 1cf59de:
And this is the corresponding call with 2c5b768:
As you can see, the |
Which, now I read, is the point of 2c5b768, but I'm not sure that I follow the rationale for it. |
That makes more sense now :-) The reason for the change in 2c5b768 is to make sure we always send something to the CouchDB server to avoid the People.by_name.skip(params[:skip] ||= 0).limit(params[:limit] ||= 30) You might also want to consider using the |
Thanks a lot, Sam, I'll make the change now. Also, I'm new to Rails so your code-style tips are much appreciated. |
It looks like Kaminari also comes a cropper with this commit, with the
|
I'm not sure I understand... clearly the limit there is at 0, which is wrong. Could you provide the view methods you're using with example data? |
Hi there,
Commit 2c5b768 seems to have broken something, since I am getting
RestClient::BadRequest
exception when listing a resource.Additional Information
The text was updated successfully, but these errors were encountered: