require 'scrivito/attribute_content' module Scrivito module AttributeContent module ClassMethods # This is new. It returns the obj class name for given subclass of BasicObj or nil def obj_class_name self.name.split('::').last if self != Obj && self != ::Obj end # Patch to work-around Scrivito::... classes in legacy mode def with_default_obj_class(attributes) return attributes if attributes[:_obj_class] || attributes["_obj_class"] return attributes if type_computer.special_class?(self) attributes.merge("_obj_class" => self.obj_class_name) end end end end