lib/generators/emotions/templates/migration.rb in emotions-0.1.2 vs lib/generators/emotions/templates/migration.rb in emotions-0.1.3
- old
+ new
@@ -1,14 +1,12 @@
class AddEmotions < ActiveRecord::Migration
def up
create_table :emotions do |t|
# The emotional model
- t.string :emotional_type
- t.integer :emotional_id
+ t.references :emotional, polymorphic: true
# The emotive model
- t.string :emotive_type
- t.integer :emotive_id
+ t.references :emotive, polymorphic: true
# The type of emotion
t.string :emotion
t.timestamps