Class: CreateAdminNotes
- Defined in:
- lib/generators/active_admin/install/templates/migrations/1_create_admin_notes.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
13 14 15 |
# File 'lib/generators/active_admin/install/templates/migrations/1_create_admin_notes.rb', line 13 def self.down drop_table :admin_notes end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/generators/active_admin/install/templates/migrations/1_create_admin_notes.rb', line 2 def self.up create_table :admin_notes do |t| t.references :resource, :polymorphic => true, :null => false t.references :admin_user, :polymorphic => true t.text :body t. end add_index :admin_notes, [:resource_type, :resource_id] add_index :admin_notes, [:admin_user_type, :admin_user_id] end |