<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,4 @@
 require 'has_markup'
-ActiveRecord::Base.send :include, HasMarkup
 
 if defined? ThoughtBot::Shoulda
   require 'has_markup/shoulda'</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,54 +1,60 @@
-module HasMarkup
-  def self.included(base)
-    base.extend ClassMethods
-  end
-  
-  # Methods that are added to ActiveRecord::Base
-  module ClassMethods
-    def has_markup(attr, options = {})
-      include HasMarkup::InstanceMethods
-      
-      options = default_has_markup_options.merge(options)
-      
-      if options[:required]
-        validates_presence_of attr
-      end
-      
-      case syntax = options[:syntax]
-      when :markdown
-        validates_markdown_syntax attr
-      else
-        raise &quot;Unsupported syntax #{syntax.inspect}. has_markup currently supports :markdown&quot;
-      end
-      
-      if options[:cache]
-        define_method &quot;cache_#{attr}&quot; do
-          cache_markup_of attr, options[:syntax]
+module HasMarkup  
+  # Modules to extend ActiveRecord
+  module ActiveRecord # :nodoc:
+    # Methods that are added to ActiveRecord::Base
+    module ClassMethods
+      def has_markup(attr, options = {})
+        extend HasMarkup::ClassMethods
+        include HasMarkup::InstanceMethods
+
+        options = default_has_markup_options.merge(options)
+
+        if options[:required]
+          validates_presence_of attr
+        end
+
+        case syntax = options[:syntax]
+        when :markdown
+          validates_markdown_syntax attr
+        else
+          raise &quot;Unsupported syntax #{syntax.inspect}. has_markup currently supports :markdown&quot;
+        end
+
+        if options[:cache]
+          define_method &quot;cache_#{attr}&quot; do
+            cache_markup_of attr, options[:syntax]
+          end
+          before_save &quot;cache_#{attr}&quot;.to_sym
         end
-        before_save &quot;cache_#{attr}&quot;.to_sym
       end
-    end
-    
-    def validates_markdown_syntax(*attrs)
-      validates_each(*attrs) do |record, attr, value|
-        begin
-          BlueCloth.new(value).to_html unless value.nil?
-        rescue BlueCloth::FormatError =&gt; e
-          errors.add attr, &quot;has #{e}&quot; 
+
+      def validates_markdown_syntax(*attrs)
+        validates_each(*attrs) do |record, attr, value|
+          begin
+            BlueCloth.new(value).to_html unless value.nil?
+          rescue BlueCloth::FormatError =&gt; e
+            errors.add attr, &quot;has #{e}&quot; 
+          end
         end
       end
+
+      def default_has_markup_options
+        {
+          :syntax =&gt; :markdown,
+          :required =&gt; false,
+          :cache =&gt; false
+        }
+      end
     end
     
-    def default_has_markup_options
-      {
-        :syntax =&gt; :markdown,
-        :required =&gt; false,
-        :cache =&gt; false
-      }
+    # Methods that are added to ActiveRecord::Base (none yet)
+    module InstanceMethods
+      
     end
+    
   end
   
-  # Methods which are added to instances of class which have been has_markupified.
+  # Methods which are added to instances of classes which have been has_markupified.
   module InstanceMethods
     def cache_markup_of(attr, syntax)
       case syntax
@@ -60,4 +66,18 @@ module HasMarkup
       end
     end
   end
+  
+  # Methods which are added to classes which have been has_markupified.
+  module ClassMethods
+  end
+end
+
+require 'active_record'
+
+
+module ActiveRecord # :nodoc:all
+  class Base
+    extend HasMarkup::ActiveRecord::ClassMethods
+    include HasMarkup::ActiveRecord::InstanceMethods
+  end
 end</diff>
      <filename>lib/has_markup.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 require 'shoulda'
 
-module HasMarkup
+module HasMarkup # :nodoc:
   # Shoulda macros for has_markup.
   module Shoulda
-    # Ensure that markup is getting cached
+    # Ensure that markup is getting cached.
     #
     #   should_cache_markup :content
     def should_cache_markup(attr)
@@ -12,7 +12,7 @@ module HasMarkup
       # TODO test that there's before_save action happening
     end
     
-    # Ensure that the model has markup
+    # Ensure that the model has markup. Accepts all the same options that has_markup does.
     #
     #   should_cache_markup :content
     def should_have_markup(attr, options = {})</diff>
      <filename>lib/has_markup/shoulda.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>93c66809569a49a6ab9239e2f9fe39e57f1e1092</id>
    </parent>
  </parents>
  <author>
    <name>Josh Nichols</name>
    <email>josh@technicalpickles.com</email>
  </author>
  <url>http://github.com/technicalpickles/has_markup/commit/792421ec33f0d8635f773001931fd2390ece392c</url>
  <id>792421ec33f0d8635f773001931fd2390ece392c</id>
  <committed-date>2008-08-01T14:50:03-07:00</committed-date>
  <authored-date>2008-08-01T14:50:03-07:00</authored-date>
  <message>Refactored how ActiveRecord::Base gets extended.</message>
  <tree>f62c3bf681e313ce908cdac33c6f8f3c4a874925</tree>
  <committer>
    <name>Josh Nichols</name>
    <email>josh@technicalpickles.com</email>
  </committer>
</commit>
