diff options
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rational.c b/rational.c index bd32399e79..ce95facda0 100644 --- a/rational.c +++ b/rational.c @@ -6,6 +6,7 @@ */ #include "internal.h" +#include "id.h" #include <math.h> #include <float.h> @@ -2610,7 +2611,7 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass) if (argc == 1) { if (!(k_numeric_p(a1) && k_integer_p(a1))) - return rb_convert_type(a1, T_RATIONAL, "Rational", "to_r"); + return rb_convert_type_with_id(a1, T_RATIONAL, "Rational", idTo_r); } else { if ((k_numeric_p(a1) && k_numeric_p(a2)) && |