This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

updated README w/ what we dont support

git-svn-id: https://svn.thoughtbot.com/plugins/when/trunk@338 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
  • Loading branch information...
1 parent d704037 commit 751f3da9647fc094c93c6e38f9ad46879aeb2b76 jcarroll committed Feb 14, 2008
Showing with 30 additions and 0 deletions.
  1. +30 −0 README
View
30 README
@@ -91,4 +91,34 @@ before_filter :log_in!,
:only => [:new, :create],
:unless => :logged_in?
+What When does NOT support
+==========================
+
+# ActiveRecord String callbacks
+before_create 'self.password = password.to_sha1',
+ :unless => lambda {|user| user.password_confirmation.blank?}
+
+# ActiveRecord Class callbacks
+before_create PasswordEncryptor,
+ :unless => lambda {|user| user.password_confirmation.blank?}
+
+# ActiveRecord Block callbacks
+before_create(:unless => lambda {|user| user.password_confirmation.blank?}) do |record|
+ record.password = record.password.to_sha1
+end
+
+# ActionController Block filters
+before_filter(:unless => :logged_in?) do |controller|
+ redirect_to new_session_path
+end
+
+# ActionController Class filters
+before_filter Authorizer,
+ :unless => :logged_in?
+
+When will not work if your code contains any of these.
+
+In our experience we've never used any of these types of callbacks and filters. By using Symbols, i.e. methods,
+the resulting code is much more intention revealing. Class callbacks and filters we feel are most of the time overkill.
+
Copyright (c) 2008 Jared Carroll and Dan Croak, released under the MIT license

0 comments on commit 751f3da

Please sign in to comment.