Sha256: 975fb38fcd59aae2ceacb96cf2f7d7f2a7e857cff5d75973f09e35aa661e1990
Contents?: true
Size: 624 Bytes
Versions: 14
Compression:
Stored size: 624 Bytes
Contents
class Export < ActiveRecord::Base belongs_to :user enum file_type: [:ttl, :nt, :xml] validates_presence_of :default_namespace before_destroy :delete_dump_file def finish!(messages) self.output = messages self.success = true self.finished_at = Time.now save! end def fail!(exception) self.output = exception.to_s + "\n\n" + exception.backtrace.join("\n") self.finished_at = Time.now save! end def build_filename File.join(Iqvoc.export_path, "#{self.token.to_s}.#{self.file_type}") end private def delete_dump_file File.delete(self.build_filename) end end
Version data entries
14 entries across 14 versions & 1 rubygems