Testing value of each related model

Posted by Novapax on Stack Overflow See other posts from Stack Overflow or by Novapax
Published on 2010-04-15T08:01:02Z Indexed on 2010/04/15 8:03 UTC
Read the original article Hit count: 163

Filed under:
|

Does Ruby (or Rails) provide an easy way to accomplish the following:

if @author.articles.each(:published == true)
  puts "all articles of this author are published"
end

I think the example speaks for itself.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about rails