Sha256: 0125ec314e4604a674fefb58f57d9da22dabefe2e85a0907d653d48fb9f8772a
Contents?: true
Size: 1.35 KB
Versions: 1
Compression:
Stored size: 1.35 KB
Contents
# ActiveRecord automigrations Create/modify/delete Active Record columns without migrations. It works only with PostgreSQL. ## Installation ``` gem 'automigration' ``` ## Usage Add <tt>has_fields</tt> into your models: ``` ruby class User < ActiveRecord::Base has_fields do string :name integer :login_count end end ``` Fire in console: `` rake db:migrate ``` To keep some system tables add to <tt>config/application.rb</tt> ``` config.automigration.system_tables << %w[hits very_system_table] ``` Supported fields: * belongs_to * boolean * date * datetime * float * integer * string * text * time ## Devise support ActiveRecord::Base supports all types of devise fields with prefix devise\_ ``` ruby class User < ActiveRecord::Base devise :database_authenticatable, :rememberable, :trackable, :validatable, :recoverable has_fields do devise_database_authenticatable :null => false devise_rememberable devise_trackable devise_recoverable end end ``` ## Timestamps By default in models with has_fields always columns updated_at and created_at created. To ignore use has_fields(:timestamps => false) ## Status [<img src="https://secure.travis-ci.org/boshie/automigration.png"/>](http://travis-ci.org/boshie/automigration) [<img src="https://gemnasium.com/boshie/automigration.png"/>](http://gemnasium.com/boshie/automigration)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
automigration-1.0.0 | README.md |