Topic: Multiple field in condition

I have two tables: Lawyer and Phone. Phone is separated into area code and number. A lawyer has many phones. Phone belongs to lawyer. I want to produce a query which searches for lawyers who have a phone matching a phone from a list of  phones.

Let's consider the following phones list:

[{:ddd=>"31", :number=>"32215411"}, {:ddd=>"32", :number=>"32215422"}]

Using plain SQL I'd do something like this in order to find lawyer IDs:

select lawyer_id from phones where (area_code, number) in (('31, '32215411'), ('32', '32215422'))

How do I translate that into ActiveRecord?

Note that

Lawyer.join(:phones).where(area_code:['31','32'], number: ['32215411', '32215422'])

wouldn't work, because that would match phone (31) 32215422.