fix(app): fixnum is deprecated

Use Integer, since Fixnum and Bigint now belong to the same class in Ruby 2.4+
This commit is contained in:
Luis Castro 2019-07-14 10:48:23 +02:00
parent e08d7836c6
commit 812d546080
No known key found for this signature in database
GPG key ID: 0A8F33D4C4E27639
2 changed files with 3 additions and 3 deletions

View file

@ -455,7 +455,7 @@ class Qx
# Quote a string for use in sql to prevent injection or weird errors
# Always use this for all values!
# Just uses double-dollar quoting universally. Should be generally safe and easy.
# Will return an unquoted value it it's a Fixnum
# Will return an unquoted value it it's a Integer
def self.quote(val)
if val.is_a?(Qx)
val.parse

View file

@ -207,9 +207,9 @@ class Qexpr
# Quote a string for use in sql to prevent injection or weird errors
# Always use this for all values!
# Just uses double-dollar quoting universally. Should be generally safe and easy.
# Will return an unquoted value it it's a Fixnum
# Will return an unquoted value it it's a Integer
def self.quote(val)
if val.is_a?(Fixnum) || (val.is_a?(String) && val =~ /^\$Q\$.+\$Q\$$/) # is a valid num or already quoted
if val.is_a?(Integer) || (val.is_a?(String) && val =~ /^\$Q\$.+\$Q\$$/) # is a valid num or already quoted
val
elsif val == nil
"NULL"