lib/spiderfw/controller/dispatcher.rb in spiderfw-0.5.13 vs lib/spiderfw/controller/dispatcher.rb in spiderfw-0.5.14
- old
+ new
@@ -39,10 +39,10 @@
if (!route.obj)
obj = dispatched_object(route)
obj.dispatch_previous = self if obj.respond_to?(:dispatch_previous=) && obj != self
route.obj = obj
if (route.options[:do])
- obj.instance_exec(*(route.params || []), &route.options[:do])
+ obj.instance_exec(*(route.params || []).slice(0, route.options[:do].arity), &route.options[:do])
end
end
obj = route.obj
new_arguments = arguments
new_arguments += route.params unless route.options[:remove_params]