-
Notifications
You must be signed in to change notification settings - Fork 364
Closed
Labels
Description
Considering a Resource set with a prefix option, if used the method find(:all)
with the option from
the records are not being instantiated with the prefix options.
class Group
self.site = "http://somesite.com"
self.prefix = "/account/:account_id/"
end
# Given no from option, works fine
Group.find(:all, params: { account_id: 1 })
# make a request to "http://somesite.com/account/1/groups.json"
# every record is instantiated with { account_id: 1 } as prefix options
# Given from option as a Symbol
People.find(:all, from: :search, params: { account_id: 1 })
# make a request to "http://somesite.com/account/1/groups/search.json"
# prefix option is empty for all records
# Given from option as a string
People.find(:all, from: "/account/1/managers", params: { account_id: 1 })
# make a request to "http://somesite.com/account/1/managers.json"
# prefix option is empty for all records
With the prefix option not available, when trying to update or delete the record the path will be malformed.