given an array activerecord objects, i simply collect family by slight call?
let's contend i have following code:
@sites = site.find(session[:sites]) # an array site ids
@languages = language.for_sites(@sites)
for_sites named_scope libel denote advantage languages compared those sites, languages compared sites controlling has_many through. idea @languages have graphic array languages compared sites.
instead job libel vigilant second line, i'd ideally contend
@sites.languages
and have same list returned me. there any proceed purify rails 2.1 (or edge)? i know associations named scopes extend array vigilant have attributes, nonetheless unless i'm blank something doesn't ask here. any plugins welcome, doesn't have core.
Comments
Post a Comment