Module: SoftDestroyable::TableDefinition
- Defined in:
- lib/soft_destroyable/table_definition.rb
Instance Method Summary collapse
-
#revive_tracking ⇒ Object
useful on migration’s for tables which were migrated with ‘soft_destroyable’ prior to revive_with_parent.
-
#soft_destroyable ⇒ Object
provide a migration short-cut for defining the required soft-destroyable columns can be used inside of a create_table or change_table (to add the columns).
Instance Method Details
#revive_tracking ⇒ Object
useful on migration’s for tables which were migrated with ‘soft_destroyable’ prior to revive_with_parent
15 16 17 |
# File 'lib/soft_destroyable/table_definition.rb', line 15 def revive_tracking column "revive_with_parent", :boolean, :default => true end |
#soft_destroyable ⇒ Object
provide a migration short-cut for defining the required soft-destroyable columns can be used inside of a create_table or change_table (to add the columns)
If you want to index on either of these fields, you need to handle that separately
8 9 10 11 12 |
# File 'lib/soft_destroyable/table_definition.rb', line 8 def soft_destroyable column "deleted", :boolean, :default => false column "deleted_at", :datetime column "revive_with_parent", :boolean, :default => true end |