change image data format

This commit is contained in:
2022-12-17 13:56:42 +02:00
parent 27bf4f4269
commit cdb9a3466a
5 changed files with 22 additions and 22 deletions

View File

@ -5,7 +5,7 @@ module Merged
belongs_to :section , class_name: "Merged::Section"
fields :id , :index , :section_id
fields :text , :header, :image
fields :text , :header, :image_name
def move_up
swap_index_with(next_card)

View File

@ -5,7 +5,7 @@ module Merged
fields :id , :page_id , :index
fields :template , :card_template
fields :header, :text , :image
fields :header, :text , :image_name
def cards
Card.where(section_id: id).order(index: :asc)

View File

@ -62,7 +62,7 @@ module Merged
end
def image
Image.find_by_name(@attributes[:image])
Image.find_by_name(self.image_name)
end
end
end