Ruby on Rails: Post.find (8 ) vs Post.where (: id => 8), не может получить комментарии для Post.where

Это приносит комментарии с post_id = 8

@onepost = Post.find(8)
@allpostsWithAssoc = @onepost.comments

Но это не приносит комментариев с post_id = 8, но почему?

@onepost = Post.where(:id => 8)
@allpostsWithAssoc = @onepost.comments

Я получаю

undefined method `comments' for #<ActiveRecord::Relation:0x9ecfce4>
0
задан shibly 16 December 2011 в 05:56
поделиться