Sha256: 8d372bba39198e513f150bd9e66f756a9aa1832f472451a4f19a1fdf1264d1e8

Contents?: true

Size: 965 Bytes

Versions: 3

Compression:

Stored size: 965 Bytes

Contents

module MultipartForm
  # Stores information about multipart forms in progress
  # Useful when displaying information about the form especially when a user
  # stops halfway through a form and comes back to it
  #
  # form_subject is a polymorphic relationship to the model that uses the form
  #
  # form_name relates to the name of the form on the model on the line
  # acts_as_multipart_form :form_name => {:type => ...
  # @author Jeremiah Hemphill
  class InProgressForm < ::ActiveRecord::Base
    set_table_name "multipart_form_in_progress_forms"
    belongs_to :form_subject, :polymorphic => true

    attr_accessible :form_subject, :form_subject_id, :form_subject_type, :form_name, :last_completed_step, :completed

    validates_presence_of :form_subject_id
    validates_presence_of :form_subject_type
    validates_presence_of :form_name
    validates_presence_of :last_completed_step
    validates_inclusion_of :completed, :in => [true, false]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
acts_as_multipart_form-0.0.16 app/models/multipart_form/in_progress_form.rb
acts_as_multipart_form-0.0.15 app/models/multipart_form/in_progress_form.rb
acts_as_multipart_form-0.0.14 app/models/multipart_form/in_progress_form.rb