Sha256: 703bfac6c59b116811f93f027f0d08b31feee0f056db27c79a46f88c41bae778
Contents?: true
Size: 902 Bytes
Versions: 4
Compression:
Stored size: 902 Bytes
Contents
class DeviseInvitableAddTo<%= table_name.camelize %> < ActiveRecord::Migration def self.up change_table :<%= table_name %> do |t| t.string :invitation_token, :limit => 60 t.datetime :invitation_sent_at t.integer :invitation_limit t.references :invited_by, :polymorphic => true t.index :invitation_token # for invitable t.index :invited_by_id end # And allow null encrypted_password and password_salt: change_column_null :<%= table_name %>, :encrypted_password, true <% if class_name.constantize.columns_hash['password_salt'] -%> change_column_null :<%= table_name %>, :password_salt, true <% end -%> end def self.down change_table :<%= table_name %> do |t| remove_references :invited_by, :polymorphic => true remove :invitation_limit, :invitation_sent_at, :invitation_token end end end
Version data entries
4 entries across 4 versions & 1 rubygems