<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -136,7 +136,15 @@ module Hobo
     module ClassMethods
 
       attr_accessor :creator_attribute
-      attr_writer :name_attribute, :primary_content_attribute
+      inheriting_cattr_accessor :name_attribute =&gt; Proc.new {
+        names = columns.*.name + public_instance_methods
+        NAME_FIELD_GUESS.detect {|f| f.in? names }
+      }
+      
+      inheriting_cattr_accessor :primary_content_attribute =&gt; Proc.new {
+        names = columns.*.name + public_instance_methods
+        PRIMARY_CONTENT_GUESS.detect {|f| f.in? names }
+      }
 
       def named(*args)
         raise NoNameError, &quot;Model #{name} has no name attribute&quot; unless name_attribute
@@ -154,22 +162,6 @@ module Hobo
         send(:login_attribute=, name.to_sym, validate) if options.delete(:login) &amp;&amp; respond_to?(:login_attribute=)
       end
 
-
-      def name_attribute
-        @name_attribute ||= begin
-                              names = columns.*.name + public_instance_methods
-                              NAME_FIELD_GUESS.detect {|f| f.in? names }
-                            end
-      end
-
-
-      def primary_content_attribute
-        @primary_content_attribute ||= begin
-                                         names = columns.*.name + public_instance_methods
-                                         PRIMARY_CONTENT_GUESS.detect {|f| f.in? names }
-                                       end
-      end
-
       def dependent_collections
         reflections.values.select do |refl|
           refl.macro == :has_many &amp;&amp; refl.options[:dependent]</diff>
      <filename>hobo/lib/hobo/model.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,12 +22,6 @@ module HoboFields
       super
     end
 
-
-    def self.field_specs
-      @field_specs ||= HashWithIndifferentAccess.new
-    end
-
-
     private
 
     # Declares that a virtual field that has a rich type (e.g. created</diff>
      <filename>hobofields/lib/hobo_fields/model_extensions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,20 +19,33 @@ class Module
   def inheriting_cattr_reader(*names)
     names_with_defaults = (names.pop if names.last.is_a?(Hash)) || {}
 
-    names_with_defaults.each do |name, default|
-      instance_variable_set(&quot;@#{name}&quot;, default) unless instance_variable_get(&quot;@#{name}&quot;) != nil || superclass.respond_to?(name)
-    end
-
     (names + names_with_defaults.keys).each do |name|
-      class_eval %{
-        def self.#{name}
-          if defined? @#{name}
-            @#{name}
-          elsif superclass.respond_to?('#{name}')
-            superclass.#{name}
+      ivar_name = &quot;@#{name}&quot;
+      block = names_with_defaults[name]
+      self.send(self.class == Module ? :define_method : :meta_def, name) do
+        if instance_variable_defined? ivar_name
+          instance_variable_get(ivar_name)
+        else
+          superclass.respond_to?(name) &amp;&amp; superclass.send(name) ||
+          block &amp;&amp; begin
+            result = block.is_a?(Proc) ? block.call : block
+            instance_variable_set(ivar_name, result) if result
           end
         end
-      }
+      end
+    end
+  end
+
+  def inheriting_cattr_accessor(*names)
+    names_with_defaults = (names.pop if names.last.is_a?(Hash)) || {}
+
+    names_with_defaults.keys.each do |name|
+      attr_writer name
+      inheriting_cattr_reader names_with_defaults.slice(name)
+    end
+    names.each do |name|
+      attr_writer name
+      inheriting_cattr_reader name
     end
   end
 </diff>
      <filename>hobosupport/lib/hobo_support/module.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>394fe24a2e628232638675795cf0bf43d1e986a6</id>
    </parent>
  </parents>
  <author>
    <name>Matt Jones</name>
    <email>al2o3cr@gmail.com</email>
  </author>
  <url>http://github.com/al2o3cr/hobo/commit/3b29193c7cac0eef2bc406665cc2deeae6399c28</url>
  <id>3b29193c7cac0eef2bc406665cc2deeae6399c28</id>
  <committed-date>2009-06-12T22:43:56-07:00</committed-date>
  <authored-date>2009-06-12T22:43:56-07:00</authored-date>
  <message>initial support for better STI behavior</message>
  <tree>36f64cab97aec3a4e6e99ded85bfe52cc75644ae</tree>
  <committer>
    <name>Matt Jones</name>
    <email>al2o3cr@gmail.com</email>
  </committer>
</commit>
