SHARE
TWEET

Untitled

a guest Jul 10th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. records
  2.         .where(
  3.             :id => Call
  4.                        .select(:call_group_id)
  5.                        .joins(:user)
  6.                        .where(
  7.                            'users.name LIKE ? OR users.last_name LIKE ?',
  8.                            "%#{name}%",
  9.                            "%#{last_name}%"
  10.                        )
  11.                        .where(
  12.                            '(`calls`.`created_at`, `call_group_id`) IN (?)',
  13.                            Call
  14.                                .select('MAX(`created_at`), `call_group_id`')
  15.                                .group(:call_group_id)
  16.                        )
  17.         )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top