#1228 ✓resolved
siplux

dm-rails benchmarking fails on Ruby 1.9.x

Reported by siplux | March 30th, 2010 @ 03:59 PM | in 1.0.0

Implicit argument passing of super from method defined by define_method(). Simple fix:

diff --git a/lib/dm-rails/railties/benchmarking_mixin.rb b/lib/dm-rails/railties/benchmarking_mixin.rb
index 498f3a3..0842a57 100644
--- a/lib/dm-rails/railties/benchmarking_mixin.rb
+++ b/lib/dm-rails/railties/benchmarking_mixin.rb
@@ -7,7 +7,7 @@ module DataMapper
         define_method method do |*args, &block|
           result = nil
           @runtime ||= 0
-          @runtime += Benchmark.ms { result = super }
+          @runtime += Benchmark.ms { result = super(*args,&block) }
           result
         end
       end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages