Closed rtablada closed 9 years ago
The only thing I know to do is a global "all primary keys are strings" or "all primary keys are integers" type config. So I guess that will have to do.
Added a config option of 'primary_keys_type' in version 1.1.0 (defaults to integer now)
I'm not sure if anyone else has run into this issue but I have been getting a lot of errors when trying to use
withAnyTag
andwithAllTag
scopes in pg databases.After some research it seems that it was a conversion issue since it was trying to do a join from an Integer
id
column from my models to thetaggable_id
field in thetagging_tagged
table.I was able to hack around this by channing the
taggable_id
field to an integer.Not sure if there's something we could do to make sure things are cast to the proper type from the query scopes in this package or maybe ship two different migration for string vs integer primary keys?
Note: Looking around this error may not be replaceable on MySQL databases since MySQL will do automatic field casts while PG and others require explicit type cast declarations.