Sha256: 412d1e8ed32e78a17dedb75e6d9cfe85ae762894ae590889eb9bd93b6a8586aa

Contents?: true

Size: 515 Bytes

Versions: 2

Compression:

Stored size: 515 Bytes

Contents

class Contact < ActiveRecord::Base

  validates_presence_of :sender_name
  validates_presence_of :sender_email
  # validates :sender_email, :presence => true, :format => { :with => /\A([\A@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :on => :create }
  validates_presence_of :body

  scope :yesterdays, lambda { where('created_at >= ? AND created_at <= ?', 1.day.ago.beginning_of_day, 1.day.ago.end_of_day ) }
  scope :chronologically, -> { order('created_at') }
  scope :by_recent, -> { order('created_at desc') }

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tkh_mailing_list-0.10.9.1 app/models/contact.rb
tkh_mailing_list-0.10.9 app/models/contact.rb