about summary refs log tree commit diff
path: root/app/models/import.rb
diff options
context:
space:
mode:
authorhalna_Tanaguru <fhalna@oceaneconsulting.com>2017-04-04 12:06:53 +0200
committerGitHub <noreply@github.com>2017-04-04 12:06:53 +0200
commit3abb0f7bc708ae8ca387aee8560b9558f8b209ba (patch)
tree6014fdec3201d9e40fa244b821bdaffc83bfa131 /app/models/import.rb
parent3f30ae1f97717177f29711d5b99d7970c6b75b3e (diff)
parenteb023beb4975a019d6a3b3091483c91c2c837bbd (diff)
Merge branch 'master' into development
Diffstat (limited to 'app/models/import.rb')
-rw-r--r--app/models/import.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/import.rb b/app/models/import.rb
new file mode 100644
index 000000000..5384986d8
--- /dev/null
+++ b/app/models/import.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class Import < ApplicationRecord
+  self.inheritance_column = false
+
+  enum type: [:following, :blocking]
+
+  belongs_to :account
+
+  FILE_TYPES = ['text/plain', 'text/csv'].freeze
+
+  has_attached_file :data, url: '/system/:hash.:extension', hash_secret: ENV['PAPERCLIP_SECRET']
+  validates_attachment_content_type :data, content_type: FILE_TYPES
+end