about summary refs log blame commit diff
path: root/app/models/import.rb
blob: 85f6ca4bdf56b36da32f49c5e8d64efa009b915b (plain) (tree)
1
2
3
4
5
6
7
8
9

                                
                                                
                                 
                                     
 
                                             
 
                                 
 
                                                                                                
                                                                   
# frozen_string_literal: true

class Import < ApplicationRecord
  FILE_TYPES = ['text/plain', 'text/csv'].freeze

  self.inheritance_column = false

  belongs_to :account, required: true

  enum type: [:following, :blocking, :muting]

  validates :type, presence: true

  has_attached_file :data, url: '/system/:hash.:extension', hash_secret: ENV['PAPERCLIP_SECRET']
  validates_attachment_content_type :data, content_type: FILE_TYPES
end