Somehow I missed that line in the documentation. Not a problem to put :class => '::Category' when I am doing this.
On Tue, Apr 26, 2016 at 7:11 PM, Jeremy Evans <[email protected]> wrote: > On Tuesday, April 26, 2016 at 11:48:15 PM UTC+2, Austin Ziegler wrote: >> >> I have a tree hierarchy that I need to keep separate from the things >> which are able to be put into that hierarchy. I’ve got this sorted out >> pretty well as shown in this gist: >> >> https://gist.github.com/b4039c821cf30af844b7d2da5820c7d7 >> >> Except for one thing: >> >> When using the many_to_one association Category::Tree.many_to_one >> :category, the inflector somehow assumes that the object is >> 'Category::Category' (and I get “warning: toplevel constant Category >> referenced by Category::Category”). This isn’t a huge problem in >> standalone, but under Rails, something goes pear-shaped and there’s a crash >> because Category::Category can’t be found as a class. >> >> This is easy enough to work around by adding class: '::Category' to the >> association declaration, but this feels like something that should just >> work, shouldn’t it? Happy to open a bug if it is one. >> > > This is the expected and documented behavior: > http://sequel.jeremyevans.net/rdoc/files/doc/association_basics_rdoc.html#label-Association+Scope > > Thanks, > Jeremy > > -- > You received this message because you are subscribed to the Google Groups > "sequel-talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sequel-talk. > For more options, visit https://groups.google.com/d/optout. > -- Austin Ziegler • [email protected] • [email protected] http://www.halostatue.ca/ • http://twitter.com/halostatue -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
