lib/restfulness/router.rb in restfulness-0.2.5 vs lib/restfulness/router.rb in restfulness-0.2.6
- old
+ new
@@ -9,10 +9,12 @@
self.routes = []
self.current_scope = []
instance_eval(&block) if block_given?
end
- def add(*args)
+ def add(*args, &block)
+ # Do we need to pretend we've been given a scope?
+ scope(*args[0..-2], &block) if block_given?
routes << Route.new(*(current_scope + args))
end
def scope(*args, &block)
old_scope = current_scope