Sha256: 3b4122736870cbc9c7d0ffa8d41a1ae75b3d6ec8369321fd0260eab98c9af3e8
Contents?: true
Size: 552 Bytes
Versions: 11
Compression:
Stored size: 552 Bytes
Contents
class Contact include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming attr_accessor :name, :email, :phone, :content, :subject # open up everything for mass assignment attr_protected validates_presence_of :name validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i validates_length_of :content, :maximum => 500 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end end def persisted? false end end
Version data entries
11 entries across 11 versions & 1 rubygems