Sha256: 77166c69c85f8b86f31742e347174493f7965760d6e8c6fb5b16357e9e6ecbca

Contents?: true

Size: 408 Bytes

Versions: 17

Compression:

Stored size: 408 Bytes

Contents

class ActsAsVotableMigration < ActiveRecord::Migration
  def self.up
    create_table :votes do |t|

      t.references :votable, :polymorphic => true
      t.references :voter, :polymorphic => true

      t.boolean :vote_flag

      t.timestamps
    end

    add_index :votes, [:votable_id, :votable_type]
    add_index :votes, [:voter_id, :voter_type]
  end

  def self.down
    drop_table :votes
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
acts_as_votable-0.4.0 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
jy-acts_as_votable-0.3.1 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
commontator-1.1.1 spec/dummy/db/migrate/3_acts_as_votable_migration.rb
commontator-1.1.0 spec/dummy/db/migrate/3_acts_as_votable_migration.rb
commontator-1.0.6 spec/dummy/db/migrate/3_acts_as_votable_migration.rb
commontator-1.0.5 spec/dummy/db/migrate/3_acts_as_votable_migration.rb
commontator-1.0.4 spec/dummy/db/migrate/3_acts_as_votable_migration.rb
commontator-1.0.3 spec/dummy/db/migrate/3_acts_as_votable_migration.rb
acts_as_votable-0.3.1 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
acts_as_votable-0.3.0 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
acts_as_votable-0.2.0 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
acts_as_votable-0.1.3 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
acts_as_votable-0.1.2 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
acts_as_votable-0.1.1 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
acts_as_votable-0.1.0 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
acts_as_votable-0.0.5 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb
acts_as_votable-0.0.4 lib/generators/acts_as_votable/migration/templates/active_record/migration.rb