Class: CreateNeutralVotes

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/neutral/install/templates/votes.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
# File 'lib/generators/neutral/install/templates/votes.rb', line 2

def change
  create_table :neutral_votes do |t|
    t.belongs_to :voter
    t.belongs_to :voteable, polymorphic: true
    t.integer :value, null: false

    t.timestamps
  end
end