Skip to content

Site paths are stripped of path when using has_one associations #334

Closed

Description

@elbowdonkey

I've submitted a PR for the following issue:

When models are defined as:

class Order < ActiveResource::Base
  self.site = "http://example.com/api/v1"
  has_one :shipping_label
end

class ShippingLabel < ActiveResource::Base
  self.site = "http://example.com/api/v1"
end

The /api/v1 portion of site is stripped when get is called for ShippingLabel.

Currently, get tries to find the associated shipping label by doing a GET to http://example.com/orders/1/shipping_label.json.

It should instead make a GET to http://example.com/api/v1/orders/1/shipping_label.json

Activity

  1. elbowdonkey commented on Jul 20, 2020

    @elbowdonkey
    Author

    Anyone want to give some feedback on this?

  2. rails-bot commented on Oct 18, 2020

    @rails-bot

    This issue has been automatically marked as stale because it has not been commented on for at least three months.
    The resources of the Rails team are limited, and so we are asking for your help.

    If it is an issue and you can still reproduce this error on the master branch,
    please reply with all of the information you have about it in order to keep the issue open.

    If it is a pull request and you are still interested on having it merged please make sure it can be merged clearly.

    Thank you for all your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions