require 'fiona7/builder/obj_builder' #require 'fiona7/write_obj' module Fiona7 module Builder class ObjUpdater < ObjBuilder protected def update? true end def validate return true end def prepare_object obj_id = @values.delete(:_id) @obj = WriteObj.find(obj_id) @path = @values.delete(:_path) @widget_pool = @values.delete(:_widget_pool) @permalink = @values.delete(:_permalink) # revert command sends this info. which is silly. @values.delete(:_last_changed) @name, parent_path = name_and_parent_path_from_path(@path) if (@path) if obj_class = @values.delete(:_obj_class) @obj_class = obj_class @real_obj_class = Fiona7::ObjClassNameMangler.new(@obj_class).mangle else @real_obj_class = @obj.obj_class @obj_class = Fiona7::ObjClassNameDemangler.new(@real_obj_class).demangle end ensure_obj_class_exists @obj.name = @name unless @name.blank? # TODO: move (parent change) end end end end