require 'rails_connector/basic_obj' require 'fiona7/shadow_classes' module RailsConnector class BasicObj def scrivito_obj Scrivito::Obj.find(self.id) end has_many(:arel_permissions, :class_name => "::RailsConnector::Permission", :foreign_key => "object_id") # never use cached permissions def permissions arel_permissions end def self.in_place(type='Obj',&block) klass = ShadowClasses.fetch(self.name,type) klass.class_eval(&block) klass end def self.widget_class self.shadow_class end def self.model_class self.shadow_class end def self.shadow_class ShadowClasses.const_get(self.name, false) end class << self def inherited(subclass,*args) super if subclass.name == 'Obj' && !::Scrivito.const_defined?('Obj', false) ::Scrivito.const_set('Obj', Class.new(::Scrivito::BasicObj)) end end end end end module Reactor module Persistence module ClassMethods def sanitize_name(old_name) old_name end end end end