Project

General

Profile

Actions

Bug #3075

closed

Integer gets turned into Float in Rational

Added by d-snp (Tinco Andringa) about 14 years ago. Updated almost 13 years ago.

Status:
Third Party's Issue
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

Actions #1

Updated by d-snp (Tinco Andringa) about 14 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

Actions #2

Updated by marcandre (Marc-Andre Lafortune) about 14 years ago

  • Status changed from Open to Third Party's Issue

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0