Sha256: 44d65b1b4375e4e096b134cf99eab6415f2773ab17d18ee754962bf60b51aaba

Contents?: true

Size: 773 Bytes

Versions: 4

Compression:

Stored size: 773 Bytes

Contents

class DynamicFormDocument < ActiveRecord::Base
  attr_protected :created_at, :updated_at

  belongs_to :dynamic_form_model

  acts_as_dynamic_form_model
  has_file_assets
  has_dynamic_forms
	has_dynamic_data

  # declare a subclass
  # pass in name of subclass
  def self.declare(klass_name)    
    Object.send(:remove_const, klass_name) if Object.const_defined?(klass_name) and !Rails.configuration.cache_classes
    Object.const_set(klass_name, Class.new(DynamicFormDocument)) unless Object.const_defined?(klass_name)
  end

  def send_email
    begin
      WebsiteInquiryMailer.inquiry(self).deliver
    rescue Exception => e
      system_user = Party.find_by_description('Compass AE')
      AuditLog.custom_application_log_message(system_user, e)
    end
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
erp_forms-3.0.2 app/models/dynamic_form_document.rb
erp_forms-3.0.1 app/models/dynamic_form_document.rb
erp_forms-3.0.0 app/models/dynamic_form_document.rb
erp_forms-2.1.0 app/models/dynamic_form_document.rb