#:enddoc: module RailsConnector class ObjClass < CmsBaseModel def self.by_name(name) obj_class_cache[name] end def self.reset_cache @obj_class_cache = nil end def name obj_class_name end def has_attribute?(name) @custom_attribute_names ||= custom_attributes.map(&:name) @custom_attribute_names.include?(name.to_s) end module ClassMethods private def obj_class_cache @obj_class_cache ||= find(:all).each_with_object({}) do |objclass, map| map[objclass.name] = objclass end end end extend ClassMethods end end