Skip to content

Commit

Permalink
Modularized (most) of the user model
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip (flip) Kromer committed May 18, 2008
1 parent 0a29c18 commit a2732fb
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 113 deletions.
3 changes: 2 additions & 1 deletion generators/authenticated/templates/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
class <%= class_name %> < ActiveRecord::Base
include Authentication
include Authentication::ByPassword
include Authentication::ByCookieToken
<% if options[:stateful] -%>
include Authorization::StatefulRoles<% end %>
Expand All @@ -26,7 +27,7 @@ class <%= class_name %> < ActiveRecord::Base
# anything else you want your user to change should be added here.
attr_accessible :login, :email, :name, :password, :password_confirmation
<% if options[:include_activation] %>
<% if options[:include_activation] && !options[:stateful] %>
# Activates the user in the database.
def activate!
@activated = true
Expand Down
43 changes: 0 additions & 43 deletions lib/authenticated.rb

This file was deleted.

68 changes: 0 additions & 68 deletions lib/authenticated/by_password.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/authorization/stateful_roles.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Authentication
module Authorization
module StatefulRoles
unless Object.constants.include? "STATEFUL_ROLES_CONSTANTS_DEFINED"
STATEFUL_ROLES_CONSTANTS_DEFINED = 'yup' # sorry for the C idiom
Expand Down

0 comments on commit a2732fb

Please sign in to comment.