2013-08-29 5 views

ответ

2

То, что я хотел бы сделать здесь создать отношения для latest_posts:

class Author 
    has_many :latest_posts, -> { limit(10) }, class_name: Post 
end 

# usage 

respond_with @authors, include: :latest_posts 
Смежные вопросы