As the title says, I have a simple ActiveResource in my application that is supposed to get data from an api. The collection works perfectly both locally and on the production server. However, .find doesn't work in production, i get a weird error:
MyResource.find(1, params: { website_id: 2 })
ArgumentError: wrong number of arguments (given 2, expected 0..1)
The same query works if I run it from local console connected to the api. API returns a valid response. I have no idea how else to debug it.
class MyResource < ActiveResource::Base
self.site = Rails.configuration.content_url
self.prefix = "/api/websites/:website_id/"
self.element_name = "game"
end
I have to say, i have other resources in the application using the same api, find method works for them, only this one has issues. for some reason it makes a call to
https://github.com/rails/rails/blob/master/activerecord/lib/active_record/core.rb#L330 with 2 arguments, but i can't figure out who makes such call. And it only happens in production mode, not in dev.