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.
Five years later... I'm searching the Internets for alternative techniques and/or implementations. I've not found anything so simple. Is this still a Good Idea™ in Rails-land circa 2017 (on version 5.1)?