Manually add file to ActiveStorage (e.g. in tests):
file_content = file_fixture('example.png').read
cat.avatar.attach(
io: StringIO.new(file_content),
filename: 'example.png'
)
Feb 14, 2025
Manually add file to ActiveStorage (e.g. in tests):
file_content = file_fixture('example.png').read
cat.avatar.attach(
io: StringIO.new(file_content),
filename: 'example.png'
)