Fix rubocop warning
This commit is contained in:
parent
5e8fd6e6cb
commit
5bb21188e4
2 changed files with 9 additions and 13 deletions
|
@ -43,12 +43,7 @@ class Trace < ActiveRecord::Base
|
|||
validates :timestamp, :presence => true
|
||||
validates :visibility, :inclusion => %w[private public trackable identifiable]
|
||||
|
||||
def destroy
|
||||
super
|
||||
FileUtils.rm_f(trace_name)
|
||||
FileUtils.rm_f(icon_picture_name)
|
||||
FileUtils.rm_f(large_picture_name)
|
||||
end
|
||||
after_destroy :remove_files
|
||||
|
||||
def tagstring
|
||||
tags.collect(&:tag).join(", ")
|
||||
|
@ -343,4 +338,12 @@ class Trace < ActiveRecord::Base
|
|||
|
||||
gpx
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def remove_files
|
||||
FileUtils.rm_f(trace_name)
|
||||
FileUtils.rm_f(icon_picture_name)
|
||||
FileUtils.rm_f(large_picture_name)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue