We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
class AbandonedTrialQuery def initialize(relation = Account.scoped) @relation = relation end def find_each(&block) @relation. where(plan: nil, invites_count: 0). find_each(&block) end end
AbandonedTrialQuery.new.find_each do |account| account.send_offer_for_support end
old_accounts = Account.where("created_at < ?", 1.month.ago) old_abandoned_trials = AbandonedTrialQuery.new(old_accounts)
There was an error while loading. Please reload this page.