Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updating README, TODO and CHANGELOG

  • Loading branch information...
commit f1ed635483652c7329433e2c4dbc4f0a2ca5abf8 1 parent 7933d20
Carlos Antonio da Silva carlosantoniodasilva authored

Showing 3 changed files with 20 additions and 9 deletions. Show diff stats Hide diff stats

  1. +4 0 CHANGELOG.rdoc
  2. +15 7 README.rdoc
  3. +1 2  TODO
4 CHANGELOG.rdoc
Source Rendered
... ... @@ -1,3 +1,7 @@
  1 +* enhancements
  2 + * Devise::Timeoutable - timeout sessions without activity
  3 + * DataMapper accepts conditions
  4 +
1 5 == 0.6.0
2 6
3 7 * deprecations
22 README.rdoc
Source Rendered
@@ -13,6 +13,7 @@ Right now it's composed of five mainly modules:
13 13 * Confirmable: responsible for verifying whether an account is already confirmed to sign in, and to send emails with confirmation instructions.
14 14 * Recoverable: takes care of reseting the user password and send reset instructions.
15 15 * Rememberable: manages generating and clearing token for remember the user from a saved cookie.
  16 +* Timeoutable: expires sessions without activity in a certain period of time.
16 17 * Validatable: creates all needed validations for email and password. It's totally optional, so you're able to to customize validations by yourself.
17 18
18 19 There's an example application using Devise at http://github.com/plataformatec/devise_example .
@@ -27,7 +28,7 @@ All gems are on gemcutter, so you need to add gemcutter to your sources if you h
27 28
28 29 sudo gem sources -a http://gemcutter.org/
29 30
30   -Install warden gem if you don't have it installed (requires 0.5.2 or higher):
  31 +Install warden gem if you don't have it installed (requires 0.6.4 or higher):
31 32
32 33 sudo gem install warden
33 34
@@ -67,10 +68,10 @@ You may also want to add some indexes to improve performance:
67 68 Now let's setup a User model adding the devise line to have your authentication working:
68 69
69 70 class User < ActiveRecord::Base
70   - devise
  71 + devise :authenticatable
71 72 end
72 73
73   -This line adds devise authenticatable automatically for you inside your User class. Devise don't rely on _attr_accessible_ or _attr_protected_ inside its modules, so be sure to setup what attributes are accessible or protected in your model.
  74 +This line adds devise authenticatable inside your User class. Devise don't rely on _attr_accessible_ or _attr_protected_ inside its modules, so be sure to setup what attributes are accessible or protected in your model.
74 75
75 76 You could also include the other devise modules as below:
76 77
@@ -78,10 +79,13 @@ You could also include the other devise modules as below:
78 79 devise :authenticatable
79 80
80 81 # Include authenticatable + confirmable
81   - devise :confirmable
  82 + devise :authenticatable, :confirmable
82 83
83 84 # Include authenticatable + recoverable + rememberable
84   - devise :recoverable, :rememberable
  85 + devise :authenticatable, :recoverable, :rememberable
  86 +
  87 + # Include authenticatable + timeoutable
  88 + devise :authenticatable, :timeoutable
85 89
86 90 # Include all of them
87 91 devise :all
@@ -93,7 +97,7 @@ Note that validations aren't added by default, so you're able to customize it. I
93 97
94 98 == Model configuration
95 99
96   -In addition to :except, you can provide :pepper, :stretches, :encryptor, :authentication_keys, :confirm_within and :remember_for as options to devise method.
  100 +In addition to :except, you can provide :pepper, :stretches, :encryptor, :authentication_keys, :confirm_within, :remember_for and :timeout as options to devise method.
97 101
98 102 All those options are described in "config/initializers/devise.rb", which is generated when you invoke `ruby script/generate devise_install` in your application root.
99 103
@@ -140,6 +144,10 @@ Finally, if you are using confirmable or recoverable, you also need to setup def
140 144 DeviseMailer.sender = "no-reply@yourapp.com"
141 145 config.action_mailer.default_url_options = { :host => 'localhost:3000' }
142 146
  147 +== Views
  148 +
  149 +By default devise will use the same views for all scopes/roles you have. But what if you need so different views to each of them? Devise also has an easy way to accomplish it: just setup :scoped_views to true inside your devise config file, and you will be able to have views based on scope like 'sessions/users/new' and 'sessions/admin/new'. If no view is found within the scope, Devise will fallback to the default view.
  150 +
143 151 == Tidying up
144 152
145 153 Devise let's you setup as many roles as you want, so let's say you already have this User model and also want an Admin model with the same authentication stuff, but not confirmation or password recovery. Just follow the same steps:
@@ -237,7 +245,7 @@ Devise implements encryption strategies for Clearance, Authlogic and Restful-Aut
237 245
238 246 == Other ORMs
239 247
240   -Devise was made to work from scratch with ActiveRecord. However it currently supports MongoMapper as well.
  248 +Devise was made to work from scratch with ActiveRecord. However it currently supports DataMapper and MongoMapper as well.
241 249 To use it, just set Devise.orm or configure it in the initialization file (which is created with devise_install).
242 250
243 251 == TODO
3  TODO
... ... @@ -1,6 +1,5 @@
1 1 * Create update_with_password
2 2 * Make test run with different ORMs
3   -* Devise::Timeoutable
4 3 * Use request_ip in session cookies
5 4 * Devise::BruteForceProtection
6   -* Devise::MagicColumns
  5 +* Devise::Trackeable

0 comments on commit f1ed635

Please sign in to comment.
Something went wrong with that request. Please try again.