Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

invalid queries being generated in tests #63

Closed
xxx opened this Issue · 3 comments

2 participants

@xxx

After updating today to gem v. 0.2.1, we're getting a number of failures in our test suite, all around SELECT/DELETE IN queries where an empty array is passed in, e.g.:

Campaign.where(:entity_id => [])

generates SELECT "campaigns".* FROM "campaigns" WHERE "campaigns"."entity_id" IN (), which is a syntax error. This only occurs in our test suite as far as we can tell. When running within a rails console, the generated query is SELECT "campaigns".* FROM "campaigns" WHERE "campaigns"."entity_id" IN (NULL), which is expected.

Removing the postgres_ext gem from the bundle resolves this issue completely, with no other changes.

@danmcclain
Owner

Thanks for finding this issue, it was a bad monkey patch on my part. I didn't copy the original code verbatim, and missed the case of an empty array. Spec added to prevent this from happening again

@danmcclain danmcclain closed this
@danmcclain
Owner

Released 0.2.2 which has this issue patched

@xxx

confirmed fixed. <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.