Permalink
Browse files

removing attr_accessible from Clearance::User.

this does not belong in an authentication library.
the application developer should decide whether they want to use
attr_accessible
  • Loading branch information...
1 parent 5bfc65f commit 61cb8e51ff3d4072acab4ebf249c9f024fcb7a31 @croaky croaky committed Jan 19, 2010
Showing with 0 additions and 21 deletions.
  1. +0 −18 lib/clearance/user.rb
  2. +0 −3 test/models/user_test.rb
View
18 lib/clearance/user.rb
@@ -24,29 +24,11 @@ def self.included(model)
model.extend(ClassMethods)
model.send(:include, InstanceMethods)
- model.send(:include, AttrAccessible)
model.send(:include, AttrAccessor)
model.send(:include, Validations)
model.send(:include, Callbacks)
end
- module AttrAccessible
- # Hook for attr_accessible white list.
- #
- # :email, :password, :password_confirmation
- #
- # Append other attributes that must be mass-assigned in your model.
- #
- # @example
- # include Clearance::User
- # attr_accessible :location, :gender
- def self.included(model)
- model.class_eval do
- attr_accessible :email, :password, :password_confirmation
- end
- end
- end
-
module AttrAccessor
# Hook for attr_accessor virtual attributes.
#
View
3 test/models/user_test.rb
@@ -2,9 +2,6 @@
class UserTest < ActiveSupport::TestCase
- should_not_allow_mass_assignment_of :email_confirmed,
- :salt, :encrypted_password, :remember_token
-
# signing up
context "When signing up" do

0 comments on commit 61cb8e5

Please sign in to comment.