Hi,
I see that Person.find(:all) and Person.find(:all, :params => {id => '2'}) returns all records irrespective of conditions. Is activeresource broken? PS: Im using rails 3.2.4
Hi,
I see that Person.find(:all) and Person.find(:all, :params => {id => '2'}) returns all records irrespective of conditions. Is activeresource broken? PS: Im using rails 3.2.4
Hi,
I see that Person.find(:all) and Person.find(:all, :params => {id => '2'}) returns all records irrespective of conditions. Is activeresource broken? PS: Im using rails 3.2.4
I dont have a column with "params".
Person.find(:all, :conditions => [ "id = ?","9"]) generates a request Started GET "/persons.json" for 127.0.0.1 => hence returns all the records
Where as Person.find(:all, {:id => '2'}) generates a request Started GET "/persons.json?id=2" for 127.0.0.1 But *returns all the records*
Seems like this has been a problem/bug from earlier versions.
http://www.rornoob.com/a/active-resource-find-with-conditions-problem/
Is there a work around for this?
Hi Ryan,
Where is not an activeresource method. Here are the list of activeresource methods http://api.rubyonrails.org/classes/ActiveResource/Base.html Also i will be using find to look for records that match multiple conditions like if name = XYZ, build = ABC etc
Better question: is the service on the other end paying any attention to the parameters? Not going to have much success if it isn’t…
–Matt Jones
Found a solution to the problem , the default index methods of the controller should be modified to return records according to the params