Merge branch 'lukas/picked_archive' into development
This commit is contained in:
commit
ddd9a9668e
|
@ -23,7 +23,7 @@ module Mongoid
|
||||||
def set_sort_number
|
def set_sort_number
|
||||||
if self.new? && self.sort_number.nil?
|
if self.new? && self.sort_number.nil?
|
||||||
last_record = self.class.desc(:sort_number).first
|
last_record = self.class.desc(:sort_number).first
|
||||||
if last_record
|
if last_record.sort_number
|
||||||
self.sort_number = (last_record.sort_number + 10) / 10 * 10
|
self.sort_number = (last_record.sort_number + 10) / 10 * 10
|
||||||
else
|
else
|
||||||
self.sort_number = 10
|
self.sort_number = 10
|
||||||
|
|
Loading…
Reference in New Issue