fixing saves

This commit is contained in:
2022-12-22 21:28:00 +02:00
parent 168320d6ee
commit 5c4123c012
9 changed files with 49 additions and 6 deletions

View File

@ -60,11 +60,10 @@ module Merged
[has_sections , has_cards]
end
def save
def save(editor)
olds = self.redirects.to_s.split(" ")
olds.delete( self.name.to_s )
self.redirects = olds.join(" ")
updated_at = Time.now
super
end

View File

@ -12,6 +12,12 @@ module Merged
fields :options , :updated_at , :updated_by
def save( editor )
self.updated_at = Time.now
self.updated_by = editor
super()
end
def has_option?(option)
options.has_key?(option) and !options[option].blank?
end