fix error
This commit is contained in:
parent
eca64d50cc
commit
7568aaafaf
|
@ -6,7 +6,7 @@ class ArchiveCategory
|
||||||
if(!record.new_record? && record.sort_number.class != Fixnum)
|
if(!record.new_record? && record.sort_number.class != Fixnum)
|
||||||
record.sort_number = 0
|
record.sort_number = 0
|
||||||
record.save
|
record.save
|
||||||
elsif(!record.new_record?)
|
elsif(!record.new_record?)
|
||||||
@category = Category.find(record.category_id) rescue nil
|
@category = Category.find(record.category_id) rescue nil
|
||||||
if !@category.nil?
|
if !@category.nil?
|
||||||
@sort_number = @category.sort_number rescue nil
|
@sort_number = @category.sort_number rescue nil
|
||||||
|
|
|
@ -15,7 +15,12 @@ class ArchiveFile
|
||||||
# BelongsToCategory = :archive_file_category
|
# BelongsToCategory = :archive_file_category
|
||||||
|
|
||||||
# PAYMENT_TYPES = @site_valid_locales
|
# 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 :title, as: :slug_title, localize: true
|
||||||
field :description, localize: true
|
field :description, localize: true
|
||||||
|
|
Loading…
Reference in New Issue