Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor
Faker::IDNumber
toFaker::IdNumber
to be more consistent with other generator's naming convention. #2858Refactor
Faker::IDNumber
toFaker::IdNumber
to be more consistent with other generator's naming convention. #2858Changes from 1 commit
fdc7d4b
be1b119
477fe71
c415987
c3cdb34
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of naming this
Deprecator
? I find it a better name because class is not adding too much to the name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking if we can do something like how ActiveSupport does but a simplified version for deprecating generators: https://github.com/rails/rails/blob/main/activesupport/lib/active_support/deprecation/constant_accessor.rb
It would be a module mixin that would add the
const_missing
and intercept calls to the deprecated module. The other mixin method would let you register the deprecated and the new modules.If we could this in a module to be included, we can just add it to the generator to
deprecate_constant
passing the generator and the replacement, ie:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think this is a good idea, will implement it that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thank you! That would fit nicely with the others to be deprecated. Let us know if you need any help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @stefannibrasil ,
Sorry for the taking so long on this but haven't had a chance to touch this till this morning.
I am not able to figure out a way to intercept the const_missing calls to the Faker module itself. i.e Faker::Constant_name. I tried to prepend the extension/module to the Faker module itself but that doesn't seem to work. will continue to look at it but interested to hear if you have way to get around that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Jamal-A-Mohamed thank you for your patience! I was almost there and @thdaraujo helped me with the final details. Here's how we could make it work: https://github.com/faker-ruby/faker/compare/main...hexdevs:faker:deprecator?expand=1
Not sure if you can cherry-pick this commit 8f54cbe to this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Great Job to you both.
I cherry picked that from your guy's commit and pushed it up.
I would need to re-read to see what I was missing.
Let me know if you want me to squash commits and or write more tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! Okay, almost there. I was testing some things on another project and pushed just one more commit here: efe80d0
Could you cherry-pick it again? That would be the only thing left before merging this. Thank you for your patience and your work on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you for helping out on this one! 🎉