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

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

Projects
None yet
7 participants
Contributor

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
@DouweM DouweM Allow for nesting of singleton belong_to's.
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
cfb2d88

👍

Contributor

lda commented Oct 29, 2012

👍

jenkek commented Nov 15, 2012

👍

+1

Contributor

joelmoss commented Jan 6, 2013

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

voondo commented Jan 7, 2013

👍

@stephenprater stephenprater pushed a commit to stephenprater/inherited_resources that referenced this pull request Feb 15, 2013

Stephen Prater (@laptop) update pr #194 to merge cleanly 3b649b8

@stephenprater stephenprater referenced this pull request Feb 15, 2013

Merged

Pull request #194 #258

@joelmoss joelmoss closed this Mar 25, 2013

@joelmoss joelmoss added a commit that referenced this pull request Mar 25, 2013

@joelmoss joelmoss Merge pull request #258 from stephenprater/pull_request_194
Pull request #194
aa599f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment