Skip to content

Commit

Permalink
Fixed show_to for Rails 3
Browse files Browse the repository at this point in the history
There are major changes in the way the unit testing is done, so I wasn't able to fix the tests.  Project for another day...
  • Loading branch information
justincinmd committed Sep 3, 2010
1 parent 99f2c0a commit 7e31949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/acl9/helpers.rb
Expand Up @@ -19,9 +19,9 @@ def access_control(method, opts = {}, &block)

# Usage:
#
# <% show_to(:owner, :supervisor, :of => :account) do -%>
# <%=show_to(:owner, :supervisor, :of => :account) do %>
# <%= 'hello' %>
# <%- end -%>
# <% end %>
#
def show_to(*args, &block)
user = eval(Acl9.config[:default_subject_method].to_s)
Expand All @@ -36,7 +36,7 @@ def show_to(*args, &block)
has_any = args.detect { |role| user.has_role?(role) }
end

has_any ? yield(:block) : ''
has_any ? capture(&block) : ''
end
end
end

0 comments on commit 7e31949

Please sign in to comment.