more fixes for save

This commit is contained in:
2022-12-23 17:37:49 +02:00
parent aba29b2809
commit 730b49a8bb
7 changed files with 55 additions and 37 deletions

View File

@ -80,15 +80,9 @@ module Merged
end
def self.new_page(name )
raise "only alphanumeric, not #{name}" unless check_name(name).nil?
data = { name: name.dup , updated_at: Time.now }
Page.new(data)
end
def self.check_name(name)
return "only alphanumeric, not #{name}" if name.match(/\A[a-zA-Z0-9]*\z/).nil?
nil
end
end
end