Sha256: b4e2ac7d769f63d4f08742957d8a6768ae919eff042b32ebfb61125d96cdf526
Contents?: true
Size: 404 Bytes
Versions: 11
Compression:
Stored size: 404 Bytes
Contents
class PopularMigration < ActiveRecord::Migration def up create_table :friendships do |t| t.references :popular_model, polymorphic: true t.references :friend, polymorphic: true t.timestamps end add_index :friendships, [:popular_model_id, :popular_model_type] add_index :friendships, [:friend_id, :friend_type] end def down drop_table :friendships end end
Version data entries
11 entries across 11 versions & 1 rubygems