fix images
This commit is contained in:
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user