- 'app/models/user.rb'
- 'lib/classic_pagination/pagination.rb'
-# Offense count: 1
-# Configuration parameters: Include.
-# Include: app/models/**/*.rb
-Rails/ActiveRecordOverride:
- Exclude:
- - 'app/models/trace.rb'
-
# Offense count: 6
# Configuration parameters: Database, Include.
# SupportedDatabases: mysql, postgresql
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(", ")
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