Skip to content

Commit

Permalink
Explicit block arg for predicates (fixes 1.9 issue)
Browse files Browse the repository at this point in the history
  • Loading branch information
nakajima committed Oct 20, 2009
1 parent 2af331c commit 2836c0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/roleful/role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(klass, name, options={})
end

def can(sym, &block)
handlers[sym] = block || proc { true }
handlers[sym] = block || proc { |arg| true }

metaclass.class_eval(<<-END, __FILE__, __LINE__)
def can_#{sym}?(target, *args)
Expand Down Expand Up @@ -60,7 +60,7 @@ def match_permission_or_predicate?(method_id)
end

def define_predicates
meta_def("#{name}?") { true }
meta_def("#{name}?") { |arg| true }
delegate_predicate("#{name}?")
delegate_predicate("can?")
end
Expand Down

0 comments on commit 2836c0a

Please sign in to comment.