How to 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?
精彩评论