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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
const concurrency = 3 |
# MOTIVATION: As rails apps are growing, people are noticing the drawbacks | |
# of the ActiveRecord pattern. Several apps I have seen, and several | |
# developers I have spoken to are looking towards other patterns for object | |
# persistence. The major drawback with ActiveRecord is that the notion | |
# of the domain object is conflated with what it means to store/retrieve | |
# it in any given format (like sql, json, key/value, etc). | |
# | |
# This is an attempt to codify the Repository pattern in a way that would | |
# feel comfortable to beginner and seasoned Ruby developers alike. | |
# |
require 'bundler/setup' | |
require 'roar/representer/json' | |
require 'roar/representer/feature/hypermedia' | |
require 'webmachine' | |
class Product | |
include Roar::Representer::JSON | |
include Roar::Representer::Feature::Hypermedia | |
property :name |