<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1 +1 @@
-ActiveRecord::Base.send :include, PermalinkFu
\ No newline at end of file
+ActiveRecord::Base.extend PermalinkFu::PluginMethods
\ No newline at end of file</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,10 +21,6 @@ module PermalinkFu
       result
     end
   end
-  
-  def self.included(base)
-    base.extend PluginMethods
-  end
 
   # This is the plugin method available on all ActiveRecord models.
   module PluginMethods
@@ -57,32 +53,33 @@ module PermalinkFu
         options = permalink_field
         permalink_field = nil
       end
-      extend ClassMethods
-      self.permalink_attributes = Array(attr_names)
-      self.permalink_field      = (permalink_field || 'permalink').to_s
-      self.permalink_options    = {:unique =&gt; true}.update(options)
-      setup_permalink_fu
+      ClassMethods.setup_permalink_fu_on self do
+        self.permalink_attributes = Array(attr_names)
+        self.permalink_field      = (permalink_field || 'permalink').to_s
+        self.permalink_options    = {:unique =&gt; true}.update(options)
+      end
     end
   end
 
   # Contains class methods for ActiveRecord models that have permalinks
   module ClassMethods
-    def self.extended(base)
+    def self.setup_permalink_fu_on(base)
+      base.extend self
       class &lt;&lt; base
         attr_accessor :permalink_options
         attr_accessor :permalink_attributes
         attr_accessor :permalink_field
       end
       base.send :include, InstanceMethods
-    end
 
-    def setup_permalink_fu
-      if permalink_options[:unique]
-        before_validation :create_unique_permalink
+      yield
+
+      if base.permalink_options[:unique]
+        base.before_validation :create_unique_permalink
       else
-        before_validation :create_common_permalink
+        base.before_validation :create_common_permalink
       end
-      class &lt;&lt; self
+      class &lt;&lt; base
         alias_method :define_attribute_methods_without_permalinks, :define_attribute_methods
         alias_method :define_attribute_methods, :define_attribute_methods_with_permalinks
       end</diff>
      <filename>lib/permalink_fu.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@ class BaseModel
     subclasses &lt;&lt; base
   end
 
-  include PermalinkFu
+  extend PermalinkFu::PluginMethods
   attr_accessor :id
   attr_accessor :title
   attr_accessor :extra</diff>
      <filename>test/permalink_fu_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bdedce0286c89008023499781dabefc1978712f6</id>
    </parent>
  </parents>
  <author>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </author>
  <url>http://github.com/technoweenie/permalink_fu/commit/cc76754d11de5d5457171a7bb50904f70fa8ae9e</url>
  <id>cc76754d11de5d5457171a7bb50904f70fa8ae9e</id>
  <committed-date>2008-09-25T00:12:30-07:00</committed-date>
  <authored-date>2008-09-25T00:12:30-07:00</authored-date>
  <message>remove the last bits of self.included and self.extended extensions</message>
  <tree>65a5dab2512981bbe18e1fe85674d5581f65063b</tree>
  <committer>
    <name>rick</name>
    <email>technoweenie@gmail.com</email>
  </committer>
</commit>
