Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

12
app/models/file_info.rb Normal file
View File

@@ -0,0 +1,12 @@
class FileInfo < ApplicationRecord
belongs_to :releasable, polymorphic: true
scope :audio, -> { where("content_type ILIKE ?", "%audio%") }
scope :video, -> { where("content_type ILIKE ?", "%video%") }
scope :photo, -> { where("content_type ILIKE ?", "%image%") }
scope :other, -> { where("NOT content_type ILIKE ?", "%(image|video|audio)%") }
def self.search_filename(query)
where("filename ILIKE ?", "%#{query}%")
end
end