- Does not save files to disk until commit.
Post.transaction do
# This one is ok. Returns true.
@post.attachments.attach(io: StringIO.new("something...."), filename: "new-post.txt", content_type: "plain/text")
# This would raise ActiveStorage::FileNotFound error.
# Plus, you won't find any new file in the filesystem until commit.
# @post.attachments.last.download