Using merge on join for records filtering

September 12, 2017

# Returns all the accounts that have unread messages.
  def self.with_unread_messages
    joins(:messages).merge( Message.unread )
  end
Using merge on join for records filtering - September 12, 2017 - {"name"=>"Stanislav Knyazev", "email"=>"extazystas@gmail.com"}