Sha256: b3a57aa2cc695d48ae8728636d15e9133f341f599b396facee48b97ced2149ba

Contents?: true

Size: 387 Bytes

Versions: 1

Compression:

Stored size: 387 Bytes

Contents

class User < ActiveRecord::Base

  scope :enabled, where(enabled: true)
  scope :search, lambda { |pattern|
    where('firstname LIKE ? OR lastname LIKE ?', "%#{pattern}%", "%#{pattern}%")
  }
  scope :created_between, lambda { |after, before|
    where('created_at >= ? AND created_at <= ?', after, before)
  }
  scope :latest, lambda {
    where('created_at >= ?', 1.week.ago)
  }

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scoped_from-0.7.0 spec/mocks/user.rb