Class: CreateValidations

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/surveyor/templates/db/migrate/create_validations.rb

Class Method Summary collapse

Class Method Details

.downObject



18
19
20
# File 'lib/generators/surveyor/templates/db/migrate/create_validations.rb', line 18

def self.down
  drop_table :validations
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/surveyor/templates/db/migrate/create_validations.rb', line 3

def self.up
  create_table :validations do |t|
    # Context
    t.integer :answer_id # the answer to validate

    # Conditional
    t.string :rule

    # Message
    t.string :message

    t.timestamps
  end
end