Q:

Call boolean instance method as a 'scope'

I have a model
Email

and an instance method
def sent_to_user?(user)
  self.who_to == user
end

where who_to is another instance method doing some complicated stuff to check.
There's a lot more stuff going on in the background there so I can't easily turn it into an activerecord query. 
I want to do something like: 
scope :sent_to_user, -> (user) { sent_to_user?(user)} 

@user.emails.sent_to_user

and return a only those emails that return true for 'sent_to_user?'
Have tried
scope :sent_to_user, -> (user) { if sent_to_user?(user)} 

....etc. 
Not quite sure how to build that scope / class method

A:

You can't (at least shouldn't) use scopes this way. Scopes are for returning ActiveRecord relations onto which additional scopes can be chained. If you want to use a scope, you should produce the necessary SQL to perform the filtering in the database.
If you want to filter results in Ruby and return an array, you should use a class-level method, not a scope:
class Email < ActiveRecord::Base
  def self.sent_to_user(user)
    select { |record| record.sent_to_user?(user) }
  end
end

