开发者

How to do a "join" with an anonymous scope in ruby

开发者 https://www.devze.com 2022-12-26 10:32 出处:网络
Hey guys (and girls ^^) !!! Does sommebody knows how to 开发者_StackOverflow中文版do a \"join\" with an anonymous scope in ruby ???

Hey guys (and girls ^^) !!!

Does sommebody knows how to 开发者_StackOverflow中文版do a "join" with an anonymous scope in ruby ??? With a named scope you just have to add ":joins =>....." but i can't really find the way to do it with anonymous ones ... .

Thx in advance for the help ;)


It probably depends on the context of where you're trying to join. Within the context of the class of any model, scope(:find) will return the parameters of the current scope and these can be combined or re-interpreted into a join if required.

Can you amend your question with some example code?

0

精彩评论

暂无评论...
验证码 换一张
取 消