Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.includes association with uuid not working #87

Open
nbaki opened this issue Oct 31, 2017 · 1 comment
Open

.includes association with uuid not working #87

nbaki opened this issue Oct 31, 2017 · 1 comment

Comments

@nbaki
Copy link

nbaki commented Oct 31, 2017

Hi,

I have the following models:

class UserGrant < ActiveRecord::Base
  belongs_to :permission
end
class Permission < ActiveRecord::Base
  self.primary_key = :id
  include ActiveUUID::UUID
  
  has_many :user_grants
end

As soon as I do something like UserGrant.includes(:permission) I get the following errors:

ERROR:  invalid input syntax for uuid: "--- !ruby/object:UUIDTools::UUID
	time_low: 3596406877
	time_mid: 22434
	time_hi_and_version: 23521
	clock_seq_hi_and_reserved: 163
	clock_seq_low: 196
	nodes:
	- 231
	- 120
	- 27
	- 208
	- 88
	- 54
	" at character 108
STATEMENT:  SELECT "permissions".* FROM "permissions" WHERE "holman_auth_permissions"."id" IN ('--- !ruby/object:UUIDTools::UUID ...)

If I remove the includes and do UserGrant.first.permission, I get the joined record just fine.

This started happening as I upgraded to Rails 4.2.10.

Any help is appreciated, thanks!

@MuneebSarfraz94
Copy link

anything worked related to this facing same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants