require 'scrivito/attribute_content' require 'fiona7/type_register' module Scrivito module AttributeContent module ClassMethods # patch attribute to notify type register alias_method :orig_attribute, :attribute def attribute(name, type, options = {}) orig_attribute(name, type, options) ensure if self.name.present? Fiona7::TypeRegister.instance.add_usr_attr(self.name, name, type, options[:values]) end end end end end