Sha256: c5674651f314337375f0841caa3fbbc7ec2196c03b048126673f6352ee5dcc80

Contents?: true

Size: 541 Bytes

Versions: 6

Compression:

Stored size: 541 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') }

  attr_accessor :website

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tkh_mailing_list-0.11.3 app/models/contact.rb
tkh_mailing_list-0.11.2 app/models/contact.rb
tkh_mailing_list-0.11.1.1 app/models/contact.rb
tkh_mailing_list-0.11.1 app/models/contact.rb
tkh_mailing_list-0.11 app/models/contact.rb
tkh_mailing_list-0.10.10 app/models/contact.rb