Sha256: f3b5c19fcbb7847fa204fcd9639711109b35e6a08947dfbaacb52e4031fa8411

Contents?: true

Size: 569 Bytes

Versions: 16

Compression:

Stored size: 569 Bytes

Contents

class ContactUs
  include ActiveModel::Conversion
  extend  ActiveModel::Naming
  include ActiveModel::Validations

  attr_accessor :full_name, :contact_number, :email, :enquiry, :donate, :captcha

  validates :full_name, :contact_number, :email, :enquiry, presence: true

  def initialize(attributes = {})
    attributes.each do |attr, value|
      self.send "#{attr}=", value
    end unless attributes.blank?
  end

  def persisted?
    false
  end

  def save
    return if captcha.present?
    if valid?
      Notification.notify_us(self).deliver
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
pixelforce_cms-2.6 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-2.5 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-2.4 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-2.3 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-2.2 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-2.0 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-1.0 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.9 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.8 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.7 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.6 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.5 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.4 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.3 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.2 lib/generators/pixelforce_cms/templates/contact_us.rb
pixelforce_cms-0.9.9.1 lib/generators/pixelforce_cms/templates/contact_us.rb