Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for nesting of singleton belong_to's. #194

Closed
wants to merge 1 commit into from

Conversation

DouweM
Copy link
Contributor

@DouweM DouweM commented Jan 8, 2012

In reference to issue #141.

Note that

class ThingAController < InheritedResources::Base
    belongs_to :thing_b, :singleton => true
end

used to mean there was only one ThingA (so resource_path == /thing_bs/123/thing_a), while it now means there is only one ThingB (so resource_path == /thing_b/thing_as/123)

To specify there is only one ThingA, you'll need

defaults :singleton => true

Note that
    class ThingAController < InheritedResource::Base
        belongs_to :thing_b, :singleton => true
    end
used to mean there was only one ThingA (so resource_path == /thing_bs/123/thing_a), while it now means there is only one ThingB (so resource_path == /thing_b/thing_as/123)

To specify there is only one ThingA, you'll need
    defaults :singleton => true
@evserykh
Copy link

👍

3 similar comments
@dmitry-a-l
Copy link
Contributor

👍

@jenkek
Copy link

jenkek commented Nov 15, 2012

👍

@seongreen
Copy link

+1

@joelmoss
Copy link
Contributor

joelmoss commented Jan 6, 2013

Any chance you can update your PR please, so it merges cleanly? thx

@voondo
Copy link

voondo commented Jan 7, 2013

👍

@stephenprater stephenprater mentioned this pull request Feb 15, 2013
@joelmoss joelmoss closed this Mar 25, 2013
joelmoss added a commit that referenced this pull request Mar 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants