From 215ba1ef3a4b95e184d260e4f5d31ab8920b6538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= Date: Thu, 29 Apr 2010 13:07:27 +0200 Subject: [PATCH] Allow :available_to to be an arbitrary predicate. When returning a straight true/false value, use that as the result, rather than comparing to the user. This allows for arbitrary predicates, such as checks on flags and states. --- hobo/lib/hobo/lifecycles/actions.rb | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hobo/lib/hobo/lifecycles/actions.rb b/hobo/lib/hobo/lifecycles/actions.rb index 483dfcb..8247f92 100644 --- a/hobo/lib/hobo/lifecycles/actions.rb +++ b/hobo/lib/hobo/lifecycles/actions.rb @@ -43,6 +43,8 @@ module Hobo user.is_a?(value) elsif value.respond_to?(:include?) value.include?(user) + elsif value === true or value === false + value else value == user end -- 1.7.0.4