-
Notifications
You must be signed in to change notification settings - Fork 132
Closed
Description
The issue as it seems global id cached on the model and if it is called more than once with different params it returns wrong result.
Check this out
> User.find(1).to_sgid.to_s == User.find(1).to_sgid(for:'asd').to_s
User Load (1.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
=> falseAnd compare to this:
> u = User.find(1)
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
=> #<User:0x007febc9f74f38 ...>
> u.to_sgid.to_s == u.to_sgid(for:'asd').to_s
=> trueReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels