Open yonahforst opened 11 years ago
No, unfortunately setting collection_path("/configurations/:configuration_id/publish_sets")
is the right way to do it.
I’ll check if there’s a way we could add support for intersting path parameters back into the fetched resource’s attributes when her initializes it.
thanks, that would be amazing.
I'm not sure how this API has their models set up, maybe has_many :through, or polymorphic. In any case, they don't return the relation id, rather the entire object. would it make sense to be able to do something like:
collection_path("/configurations/#{configuration.id}/publish_sets")
Also, I noticed that every object has its own url embedded as an attribute.
#<Skytap::Configuration(configurations/799324) id="799324" url="https://cloud.skytap.com/configurations/799324" name="234921" error="" runstate="stopped" suspend_on_idle=1800 routable=false .....>
I don't know if this is standard practice with REST APIs. If it is, would it make sense to allow the objects path to be inferred from the object itself (url attribute)?
I am having a similar issue with attempting to destroy_existing
on a nested resource. Has any progress been made to address this issue?
@joshblour Do you have a gist of how you used delete_raw
as a work around?
This association works as expected for get requests:
but for delete requests:
I need to make it so that delete requests use the full nested url DELETE .../configurations/1234/publish_sets/5678
I tried setting collection_path("/configurations/:configuration_id/publish_sets") but the publish_set objects i get back from the api don't have the configuration_id param, only a configuration object.
Is there anyway to do this kind of delete through the association instead of a delete_raw (how i'm doing it now)