Sha256: fc31e87cc2d7e236f797edb97eb55263dd42b55f19c61bf18af85a64dc427b20

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

module DeviseInvitable
  module Schema
    # Add invitation_token and invitation_sent_at columns in the resource's database table.
    #
    # Examples
    #
    #   # For a new resource migration:
    #   create_table :the_resources do
    #     t.database_authenticatable :null => false # you need at least this
    #     t.invitable
    #     ...
    #   end
    #   add_index :the_resources, :invitation_token # for invitable
    #
    #   # or if the resource's table already exists, define a migration and put this in:
    #   change_table :the_resources do |t|
    #     t.string   :invitation_token, :limit => 60
    #     t.datetime :invitation_sent_at
    #     t.index    :invitation_token # for invitable
    #   end
    #
    #   # And allow encrypted_password to be null:
    #   change_column :the_resources, :encrypted_password, :string, :null => true
    #   # the following line is only if you use Devise's encryptable module!
    #   change_column :the_resources, :password_salt,      :string, :null => true
    def invitable
      apply_devise_schema :invitation_token,   String, :limit => 60
      apply_devise_schema :invitation_sent_at, DateTime
    end
  end
end

Devise::Schema.send :include, DeviseInvitable::Schema

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
devise_invitable-0.4.rc lib/devise_invitable/schema.rb
dougjohnston-devise_invitable-0.4.rc lib/devise_invitable/schema.rb
aihs_devise_invitable-0.4.rc lib/devise_invitable/schema.rb