Sha256: f1b1dcb351c31bdf2593bbc5d44298ce84fff3ccb838d0e71ebb0117f2d3a3fa

Contents?: true

Size: 342 Bytes

Versions: 5

Compression:

Stored size: 342 Bytes

Contents

class FormSubmission < ActiveRecord::Base
  include Concerns::Emailable

  belongs_to :form
  has_many :data, foreign_key: :submission_id, class_name: 'FormSubmissionData'

  validates :form, presence: true

  def data_object
    data.inject(OpenStruct.new) do |stack, d|
      stack.send("#{d.name}=", d.value)
      stack
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
udongo-1.0.4 app/models/form_submission.rb
udongo-1.0.3 app/models/form_submission.rb
udongo-1.0.2 app/models/form_submission.rb
udongo-1.0.1 app/models/form_submission.rb
udongo-1.0.0 app/models/form_submission.rb