Sha256: 11d7ef3f8da2c9174bb1c26bd3913bfa45a4d25bc4fbfa87ecdeea744fa56ce6

Contents?: true

Size: 912 Bytes

Versions: 7

Compression:

Stored size: 912 Bytes

Contents

class UpdateContactForm
  
  def self.up
    model = DynamicFormModel.find_by_model_name('WebsiteInquiry')
    model.create_role

    fields = []

    fields << DynamicFormField.textfield({:fieldLabel => 'First Name', :name => 'first_name', :width => 250, :allowBlank => false })
    fields << DynamicFormField.textfield({:fieldLabel => 'Last Name', :name => 'last_name', :width => 250, :allowBlank => false })
    fields << DynamicFormField.email({:fieldLabel => 'Email', :name => 'email', :width => 250, :allowBlank => false })
    fields << DynamicFormField.textarea({:fieldLabel => 'Message', :name => 'message', :width => 400, :height => 200, :allowBlank => false })    
    
    d = DynamicForm.find_by_internal_identifier('contact_us')
    unless d.nil?
      d.definition = fields.to_json
      d.msg_target = 'qtip'
      d.save    
    end    
  end
  
  def self.down
    #remove data here
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
erp_forms-3.1.2 db/data_migrations/20121026191738_update_contact_form.rb
erp_forms-3.1.1 db/data_migrations/20121026191738_update_contact_form.rb
erp_forms-3.1.0 db/data_migrations/20121026191738_update_contact_form.rb
erp_forms-3.0.2 db/data_migrations/20121026191738_update_contact_form.rb
erp_forms-3.0.1 db/data_migrations/20121026191738_update_contact_form.rb
erp_forms-3.0.0 db/data_migrations/20121026191738_update_contact_form.rb
erp_forms-2.1.0 db/data_migrations/20121026191738_update_contact_form.rb