fix error
This commit is contained in:
parent
7568aaafaf
commit
5758a91865
|
@ -18,7 +18,7 @@ class ArchiveFile
|
||||||
before_save do
|
before_save do
|
||||||
cat = self.category rescue nil
|
cat = self.category rescue nil
|
||||||
if cat && ArchiveCategory.where(:category_id => cat.id).count==0
|
if cat && ArchiveCategory.where(:category_id => cat.id).count==0
|
||||||
ArchiveCategory.create(category_id: cat.id.to_s)
|
ArchiveCategory.create(category_id: cat.id.to_s,sort_number: cat.sort_number)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -109,10 +109,10 @@ class ArchiveFile
|
||||||
end
|
end
|
||||||
|
|
||||||
def save_archive_file_multiples
|
def save_archive_file_multiples
|
||||||
self.archive_file_multiples.each do |t|
|
self.archive_file_multiples.each do |t|
|
||||||
if t.should_destroy
|
if t.should_destroy
|
||||||
t.destroy
|
t.destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue