@posts = Post.where(user_id:123).includes(:comments).where("comments.created_at IN (?) OR comments.updated_at IN (?)", Time.zone.today...Time.zone.tomorrow, Time.zone.today...Time.zone.tomorrow)
Post.where(id: 1).or(Post.where(id: 2))
{"created_at >= ? AND created_at < ?", "2016-06-23", "2016-06-24"}
@posts = Post.where(user_id:123).includes(:comments).where(comments: { created_at: Time.zone.today...Time.zone.tomorrow })
match
в JS (да и во всех реализациях) возвращает массив, то вы просто выбираете 3-ий элемент. Т.е:(.*)
.*/list = [101,102,103,104,105]
=> [101, 102, 103, 104, 105]
list2 = [101,102,103]
=> [101, 102, 103]
(list-list2) | (list2-list)
=> [104, 105]