forked from OpenNeo/impress
oh shoot, properly unlink outfit tempfiles now...
This commit is contained in:
parent
a6e4398e54
commit
2435c7f7e9
1 changed files with 4 additions and 1 deletions
|
@ -91,12 +91,15 @@ class Outfit < ActiveRecord::Base
|
|||
# and runs #save! on the record, so any other changes will also be saved.
|
||||
def write_image!
|
||||
if image_layers_dirty?
|
||||
Tempfile.open(['outfit_image', '.png']) do |image|
|
||||
image = Tempfile.open(['outfit_image', '.png'])
|
||||
begin
|
||||
create_image! image
|
||||
self.image_layers_hash = generate_image_layers_hash
|
||||
self.image = image
|
||||
self.image_enqueued = false
|
||||
save!
|
||||
ensure
|
||||
image.close!
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue