Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/plsql/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,12 @@ def drop_session_ruby_temporary_tables
exec "DROP TABLE #{row[0]}"
end
end

private

def ora_number_to_ruby_number(num)
# return BigDecimal instead of Float to avoid rounding errors
num == (num_to_i = num.to_i) ? num_to_i : (num.is_a?(BigDecimal) ? num : BigDecimal(num.to_s))
end
end
end
5 changes: 0 additions & 5 deletions lib/plsql/jdbc_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,5 @@ def java_timestamp(value)
def java_bigdecimal(value)
value && java.math.BigDecimal.new(value.to_s)
end

def ora_number_to_ruby_number(num)
# return BigDecimal instead of Float to avoid rounding errors
num == (num_to_i = num.to_i) ? num_to_i : (num.is_a?(BigDecimal) ? num : BigDecimal(num.to_s))
end
end
end
5 changes: 0 additions & 5 deletions lib/plsql/oci_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ def raw_oci_connection
end
end

def ora_number_to_ruby_number(num)
# return BigDecimal instead of Float to avoid rounding errors
num == (num_to_i = num.to_i) ? num_to_i : (num.is_a?(BigDecimal) ? num : BigDecimal(num.to_s))
end

def ora_date_to_ruby_date(val)
case val
when DateTime
Expand Down