Sha256: 4b80ff81849a91482334b1d7ebaa261c9872f0791955cfca7ee9a20af071d584

Contents?: true

Size: 522 Bytes

Versions: 5

Compression:

Stored size: 522 Bytes

Contents

class Inquiry < ActiveRecord::Base

  validates_presence_of :name
  validates_format_of :email,
                      :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,
                      :message => 'must be valid'

  acts_as_indexed :fields => [:name, :email, :message, :phone],
                  :index_file => [Rails.root.to_s, "tmp", "index"]

  def self.closed
    find_all_by_open(false, :order => "created_at DESC")
  end

  def self.opened
    find_all_by_open(true, :order => "created_at DESC")
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
refinerycms-0.9.6.7 vendor/plugins/inquiries/app/models/inquiry.rb
refinerycms-0.9.6.6 vendor/plugins/inquiries/app/models/inquiry.rb
refinerycms-0.9.6.5 vendor/plugins/inquiries/app/models/inquiry.rb
refinerycms-0.9.6.4 vendor/plugins/inquiries/app/models/inquiry.rb
refinerycms-0.9.6.3 vendor/plugins/inquiries/app/models/inquiry.rb