Permalink
Browse files

Supports :all for ssl_allowed and ssl_required

  • Loading branch information...
1 parent 34a9a13 commit 7fd8fbbbf986410297e6d66843d00e2a9c19a94f @crudson committed Mar 4, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/ssl_requirement.rb
@@ -38,11 +38,13 @@ def ssl_allowed(*actions)
protected
# Returns true if the current action is supposed to run as SSL
def ssl_required?
- (self.class.read_inheritable_attribute(:ssl_required_actions) || []).include?(action_name.to_sym)
+# (self.class.read_inheritable_attribute(:ssl_required_actions) || []).include?(action_name.to_sym)
+ (self.class.read_inheritable_attribute(:ssl_required_actions) || []).any? { |a| a == :all || a == action_name.to_sym }
end
def ssl_allowed?
- (self.class.read_inheritable_attribute(:ssl_allowed_actions) || []).include?(action_name.to_sym)
+# (self.class.read_inheritable_attribute(:ssl_allowed_actions) || []).include?(action_name.to_sym)
+ (self.class.read_inheritable_attribute(:ssl_allowed_actions) || []).any? { |a| a == :all || a == action_name.to_sym }
end
private

0 comments on commit 7fd8fbb

Please sign in to comment.