Sha256: 26f0e75b233f1ff073f810d267af537c271f93ae4c02c8c0c64e31aff7e89e2a

Contents?: true

Size: 533 Bytes

Versions: 14

Compression:

Stored size: 533 Bytes

Contents

class Contact
  include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Naming
  
  attr_accessor :name, :email, :subject, :body
  
  validates_presence_of :name
  validates_format_of :email, :with => /^[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$/i
  validates_presence_of :email
  validates_presence_of :subject
  validates_presence_of :body

  def initialize(attributes = {})
    attributes.each do |name, value|
      send("#{name}=", value)
    end
  end
  
  def persisted?
    false
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
adminpanel-1.2.12 app/models/contact.rb
adminpanel-1.2.11 app/models/contact.rb
adminpanel-1.2.10 app/models/contact.rb
adminpanel-1.2.9 app/models/contact.rb
adminpanel-1.2.8 app/models/contact.rb
adminpanel-1.2.7 app/models/contact.rb
adminpanel-1.2.6 app/models/contact.rb
adminpanel-1.2.5 app/models/contact.rb
adminpanel-1.2.4 app/models/contact.rb
adminpanel-1.2.3 app/models/contact.rb
adminpanel-1.2.2 app/models/contact.rb
adminpanel-1.2.1 app/models/contact.rb
adminpanel-1.2.0 app/models/contact.rb
adminpanel-1.1.0 app/models/contact.rb