fix error

This commit is contained in:
chiu 2021-09-17 13:43:32 +08:00
parent eca64d50cc
commit 7568aaafaf
2 changed files with 7 additions and 2 deletions

View File

@ -15,7 +15,12 @@ class ArchiveFile
# BelongsToCategory = :archive_file_category
# PAYMENT_TYPES = @site_valid_locales
before_save do
cat = self.category rescue nil
if cat && ArchiveCategory.where(:category_id => cat.id).count==0
ArchiveCategory.create(category_id: cat.id.to_s)
end
end
field :title, as: :slug_title, localize: true
field :description, localize: true