Namespaced models and controllers in a polymorphic belongs_to relationship don't work #168

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants
Contributor

gaizka commented Sep 9, 2011

In a polymorphic belongs_to relationship, you cannot specity parent_class
option. So, if the models are namespaces, you would not be able to find them.

When looking for the model, try the same namespace as the one the controller is.

@gaizka gaizka Try to find namespaced models in a polymorphic belongs_to relationship
In a polymorphic belongs_to relationship, you cannot specity parent_class
option. So, if the models are namespaces, you would not be able to find them.

When looking for the model, try the same namespace as the one the controller is.
c936b70

ep-wac commented Sep 21, 2012

with a class Admin::OxenController and an AttachmentsController belongs_to :ox, :page, :optional => true, and calling collection_url on a /admin/oxen/1/attachments/new request, I'm left with

undefined method `ox_attachments_url' for #<AttachmentsController:0x007fd30095f120>

@gaizka I tried this commit but I probably does not understand it 'enough' - it still throws the above error

Member

boie0025 commented Apr 29, 2013

👍

Contributor

ka8725 commented Aug 9, 2013

👍

Contributor

ka8725 commented Aug 13, 2013

This code looks complicated because of nested rescue and doesn't contain the tests for changes. I've created other pull request which resolves this problem. I hope it will be merged sometime.

Collaborator

rafaelfranca commented Oct 10, 2014

Closing because #303 was already merged.

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