-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove ffaker #2339
Remove ffaker #2339
Conversation
@@ -15,7 +15,7 @@ | |||
address1 '10 Lovely Street' | |||
address2 'Northwest' | |||
city 'Herndon' | |||
zipcode { FFaker::AddressUS.zip_code } | |||
sequence(:zipcode, 10001) { |i| i.to_s } |
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.
Use underscores(_) as decimal mark and separate every 3 digits with them.
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.
no 😠
I have disabled this rule.
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.
👌🏼
@@ -4,6 +4,6 @@ | |||
FactoryBot.define do | |||
factory :promotion_code, class: 'Spree::PromotionCode' do | |||
promotion | |||
value { generate(:random_code) } | |||
sequence(:value) {|i| "code#{i}" } |
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.
Space between { and | missing.
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.
You had me at "Remove".
FFaker is required where it is used.
6108ace
to
10b8830
Compare
Previously here we used TwitterCldr to generate zip codes, which we replaced with FFaker. Neither of these generated accurate zipcodes for the state they were in. We might as well just generate codes from 10001 onwards (which should mostly be valid codes in Manhattan).
10b8830
to
83d5ffd
Compare
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
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.
Thanks!
They are no more present since solidusio/solidus#2339 Also, it follows the direction of the above PR and remove unnecessary fields from some facotry to create minimal objects.
Following solidusio/solidus#2339
We are no longer using ffaker for sample data as of #2163. So we might as well remove the dependency entirely.
The main advantage of ffaker is being able to create data that looks to a human to be somewhat real. This isn't necessary or even desirable for the factories used by our specs, which just need different data. FactoryBot's
sequence
s are totally adequate for these purposes.This also removes a few "description" fields from factories of models where they were optional (factories should be creating minimal objects).