Closed chunpan closed 6 years ago
good spot, nice piece of work.
I will have no look at this PR in depth over this Weekend as this Gem is significant in many projects. But in principle you are right that was a bug
gem 1.2.2 released https://rubygems.org/gems/public_uid/versions/1.2.2
thank you once again ;)
The Problem:
The custom uid column feature fails to generate uids when used in a real Rails application.
Analysis:
public_uid
default column names still exist in theSetPublicUid
service, as well as thegenerate.rake
task.users
table was created with bothpublic_uid
andcustom_uid
, therefore causing this bug to be disguised.generate_uid
in the model withcustom_uid
column.generate.rake
task.Solution:
public_uid
column.custom_uid
column.no such column
orunknown attribute
type of errors that I've seen in my Rails app.custom_uid
column.public_uid
orcustom_uid
values for existing records that don't have these values.SetPublicUid
andgenerate.rake
task, all tests would pass.