Gui improvements, ordering
This commit is contained in:
parent
6db0b64f4c
commit
42c077f6ab
28 changed files with 105 additions and 40 deletions
|
|
@ -3,4 +3,11 @@ class Page < ApplicationRecord
|
|||
has_many :elements, dependent: :destroy
|
||||
|
||||
has_rich_text :comment
|
||||
|
||||
before_validation :set_position
|
||||
|
||||
private
|
||||
def set_position
|
||||
self.position ||= (report.pages.pluck(:position).max || 0) + 1
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue