Class: CreateNeutralVotings

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

Instance Method Summary collapse

Instance Method Details

#changeObject



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

def change
  create_table :neutral_votings do |t|
    t.belongs_to :votingable, polymorphic: true
    t.integer :positive, default: 0
    t.integer :negative, default: 0

    t.timestamps
  end
end