このコミットが含まれているのは:
2026-06-25 07:44:11 +09:00
コミット fa6c547cc9
11個のファイルの変更865行の追加323行の削除
+13
ファイルの表示
@@ -15,6 +15,7 @@ class Material < ApplicationRecord
has_many :material_export_items, dependent: :destroy
has_one_attached :file, dependent: :purge
has_one_attached :thumbnail, dependent: :purge
validates :tag_id, presence: true, uniqueness: true
@@ -28,6 +29,18 @@ class Material < ApplicationRecord
file.blob.content_type
end
def file_byte_size
return nil unless file&.attached?
file.blob.byte_size
end
def file_filename
return nil unless file&.attached?
file.blob.filename.to_s
end
def file_suppressed? = file_suppressed_at.present?
def snapshot_export_paths