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
Hey! Thanks for your work! The gem works great!
What do you think about factory_bot helper especially for this gem? Or maybe README update about how to create factories.
factory_bot
I've spent half a hour to figure out how to create working factory for my model with has_one_base64_attached :avatar.
has_one_base64_attached :avatar
So, I succeed with this code
FactoryBot.define do factory :user do avatar do image_url = Faker::LoremFlickr.image image_data = URI.open(image_url).read { data: "data:image/png;base64, #{Base64.strict_encode64(image_data)}" } end end end
Adding the whole string to hash as value by key data was not obvious in the beginning.
data
FactoryBot helper will be something like that:
FactoryBot.define do factory :user do avatar do image_url = Faker::LoremFlickr.image image_data = URI.open(image_url).read base64_attached(image_data) end end end
I would be happy to make a contribution. You must just choose:
OR
Waiting for your decision 🦭
The text was updated successfully, but these errors were encountered:
Hey @kalashnikovisme, thanks for your contribution. I think providing a FactoryBot helper would be a better approach, thanks for the suggestion!
Sorry, something went wrong.
No branches or pull requests
Hey! Thanks for your work! The gem works great!
What do you think about
factory_bot
helper especially for this gem? Or maybe README update about how to create factories.I've spent half a hour to figure out how to create working factory for my model with
has_one_base64_attached :avatar
.So, I succeed with this code
Adding the whole string to hash as value by key
data
was not obvious in the beginning.FactoryBot helper will be something like that:
I would be happy to make a contribution. You must just choose:
OR
Waiting for your decision 🦭
The text was updated successfully, but these errors were encountered: