0
我想获取过去一天制作的“帖子”的集合,并获取其作者的所有电子邮件。获取与其他模型记录集关联的所有模型记录
安author has_many posts
。
第1步:创建的所有帖子今日(作品)
Posts.where('created_at > :today', today: Time.zone.now.beginning_of_day)
步骤2:(?究竟是什么语法)获取的所有作者,这些职位
Posts.where('created_at > :today', today: Time.zone.now.beginning_of_day).authors??? # Returns undefined method for ActiveRecord_Relation.