| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
In your Gemfile
gem 'evolution', :github => 'culturecode/evolution'Generate the tables
rails generate evolution:migrationAdd the tracking columns to your own tables in a migration
add_column 'my_models', :extinct, :boolean, :default => false
add_column 'my_models', :generation, :integer
add_index 'my_models', :extinct
MyModel.update_all(:extinct => false)
MyModel.update_all(:generation => 1)
MyModel.reset_hierarchy
change_column_null 'my_models', :extinct, false
change_column_null 'my_models', :generation, falsedoc = Document.create
new_doc = doc.evolve
new_doc.generation #=> 2| Back | FazBrowse Home | New Git URL |