Project

General

Profile

Bug #3075

Integer gets turned into Float in Rational

Added by d-snp (Tinco Andringa) over 9 years ago. Updated over 8 years ago.

Status:
Third Party's Issue
Priority:
Normal
Assignee:
-
ruby -v:
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin9.7.0]
[ruby-core:29192]

Description

=begin
This bug is as weird as the subject sounds:

http://pastie.org/898271

I'm sorry it uses a method from activesupport, I couldn't trigger the bug without activesupport, yet because it seems to do this weird object magic trick in between method calls I think it has to do something with ruby.

I hope this makes sense to you,

Greetings, Tinco
=end

History

#1

Updated by d-snp (Tinco Andringa) over 9 years ago

=begin
I figured it out. Since the Duration object responds to .kind_of? Integer it gets turned into a rational, and then the function is recursed. Because @numerator is a Bignum and a.numerator a Duration, coerce gets called, and both are turned into floats. Duration should've overrode coerce, the problem lies with active_support so this ticket can be closed.
=end

#2

Updated by marcandre (Marc-Andre Lafortune) over 9 years ago

  • Status changed from Open to Third Party's Issue

=begin

=end

Also available in: Atom PDF