forked from spen/seminar
Merge pull request 'Fix bug.' (#5) from 123/seminar:master into master
Reviewed-on: spen/seminar#5
This commit is contained in:
commit
f2ab125ae6
|
@ -51,10 +51,9 @@ class SeminarSignup
|
||||||
[l, (tmp ? tmp : unit)]
|
[l, (tmp ? tmp : unit)]
|
||||||
end.to_h
|
end.to_h
|
||||||
if self.serial_number.nil?
|
if self.serial_number.nil?
|
||||||
s = SeminarMain.find(self.seminar_main)
|
last_serial_number = SeminarMain.where(:id=>self.seminar_main_id).max(:last_serial_number).to_i
|
||||||
s.last_serial_number += 1
|
self.serial_number = last_serial_number + 1
|
||||||
self.serial_number = s.last_serial_number
|
SeminarMain.where(:id=>self.seminar_main_id).update_all({"$inc"=>{"last_serial_number"=>1}})
|
||||||
s.save(:validate=>false)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
after_destroy do
|
after_destroy do
|
||||||
|
|
Loading…
Reference in New Issue