Permalink
Browse files

Catch nil limit for floats

I had this line in a migration:
`add_column :locations, :latitude, :float`

When limit isn't supplied, limit is defaulted to nil. An error occurs when nil is compared with 4.
  • Loading branch information...
rzane committed Nov 9, 2013
1 parent bc752bb commit 0f5679b5567b683a3e3ccdc30802c7873b27b0e5
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/active_record/connection_adapters/fb_adapter.rb
@@ -884,7 +884,7 @@ def integer_to_sql(limit)
end

def float_to_sql(limit)
if limit <= 4
if limit.nil? || limit <= 4
'float'
else
'double precision'

0 comments on commit 0f5679b

Please sign in to comment.