ruby on rails - input from form being converted to decimal on insert -


i have db column upc codes setup 'numeric' data type in postgres.

i generated scaffolding input values table, rails converting input in float reason,

eg, 13 digit number entry 1234567890000 converted 1234567890000.0

from logs:

insert "upc_codes" ("upccode") values (1234567890000.0) returning "id"

where data type sql statement being set, or not set case may be?

what data type using column? try changing column type integer in migration:

change_column :upc_codes, :upc_code, :integer 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -