jbox-web / ajax-datatables-rails

A wrapper around DataTable's ajax methods that allow synchronization with server-side pagination in a Rails app
MIT License
585 stars 228 forks source link

Searching not working against bigint #337

Open uu opened 5 years ago

uu commented 5 years ago

If column is bigint, then datatable considers it a string. Empty string.

@view_columns ||= {barcode: { source: 'Product.barcode', cond: :eq, orderable: false }}

barcode = 123123123

SELECT  "products".* FROM "products" WHERE "products"."barcode" = 123123123

barcode = 96749800858

SELECT  "products".* FROM "products" WHERE CAST("products"."barcode" AS VARCHAR) ILIKE ''
snex commented 1 year ago

Has anyone figured out a solution to this? 3 years later and it's still a problem. Rails uses bigint for primary keys by default when creating a table so this seems like a pretty major issue.