We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This works:
Foo < ActiveRecord::Base generate_public_uid generator: PublicUid::Generators::HexStringSecureRandom.new(50) end foo = Foo.new foo.save! foo.public_uid.length # => 50
this wil not
```ruby Bar <Foo end foo = Foo.new foo.save! foo.public_uid.length # => 8
due to https://github.com/equivalent/public_uid/blob/master/lib/public_uid/model.rb#L25 instance method set the config is not copied across inheritance which is bad in this case
possible solution: use class variables @@generator =
@@generator =
The text was updated successfully, but these errors were encountered:
🤔 or inherited hook will be more OOP way https://www.sitepoint.com/rubys-important-hook-methods/
inherited
update
on second tought that causes lot of errors on Rails as Rails does some weird reloads on inheritance
Sorry, something went wrong.
No branches or pull requests
This works:
this wil not
due to https://github.com/equivalent/public_uid/blob/master/lib/public_uid/model.rb#L25 instance method set the config is not copied across inheritance which is bad in this case
possible solution: use class variables
@@generator =
The text was updated successfully, but these errors were encountered: