fix images

This commit is contained in:
2022-12-12 18:35:18 +02:00
parent 7966437324
commit e6effde4ff
5 changed files with 11 additions and 8 deletions

View File

@ -7,7 +7,8 @@ module Merged
include Optioned
fields :index , :section_id, :id , :text , :header, :image
fields :id , :index , :section_id
fields :text , :header, :image , :options
def move_up
swap_index_with(next_card)

View File

@ -55,13 +55,14 @@ module Merged
end
def save
updated_at = Time.now
super
Page.save_all
end
def self.new_page(name )
raise "only alphanumeric, not #{name}" unless check_name(name).nil?
data = { name: name.dup }
data = { name: name.dup , updated_at: Time.now }
Page.new(data)
end

View File

@ -7,8 +7,9 @@ module Merged
include Optioned
fields :name , :page_id , :index , :options
fields :template , :card_template , :id , :text , :header, :image
fields :id , :name , :page_id , :index
fields :template , :card_template
fields :header, :text , :image , :options
def cards
Card.where(section_id: id).order(index: :asc)