Permalink
Browse files

Make show_to backwards compatible with rails 2.3.x

  • Loading branch information...
1 parent ac7d61a commit 4d0c7959452eaa868f79ab685c17b7008dcbf4a1 @javierg committed Apr 11, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/acl9/helpers.rb
View
9 lib/acl9/helpers.rb
@@ -36,7 +36,14 @@ def show_to(*args, &block)
has_any = args.detect { |role| user.has_role?(role) }
end
- has_any ? capture(&block) : nil
+ if has_any
+ begin
+ capture( &block )
+ rescue NoMethodError
+ yield( :block )
+ end
+ end
+
end
end
end

0 comments on commit 4d0c795

Please sign in to comment.