Example usage:
old_accounts = Account.where("created_at < ?", 1.month.ago)
old_abandoned_trials = AbandonedTrialQuery.new(old_accounts)
old_abandoned_trials.find_each do |account|
account.send_offer_for_support
end
I've been using this pattern for a while, but this particular example is a re-imagining of @brynary's Extract Query Objects pattern.
Nice, thanks for this example. Works a treat!