<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -132,6 +132,10 @@ module DataMapper
       end
   
       module InstanceMethods
+
+        def commentable_class
+          Kernel.const_get(self.commentable_class_name)
+        end
         
         def commenting_rateable?
           self.class.commenting_rateable?
@@ -264,4 +268,4 @@ module DataMapper
       
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/dm-is-commentable/is/commentable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -76,6 +76,11 @@ if HAS_SQLITE3 || HAS_MYSQL || HAS_POSTGRES
   
     describe &quot;every commentable&quot;, :shared =&gt; true do
 
+      it &quot;should return class of comments model&quot; do
+        Trip.new.respond_to?(:commentable_class).should be_true
+        Trip.new.commentable_class.should == TripComment
+      end
+
       it &quot;should define a remixed model that can be auto_migrated&quot; do
         # once it's migrated it stays in the database and can be used by the other specs
         Object.const_defined?(&quot;TripComment&quot;).should be_true</diff>
      <filename>spec/integration/commentable_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d827713916be6fb13f5a5b5301f2b8aa8ad2737a</id>
    </parent>
  </parents>
  <author>
    <name>Peter Sarnacki</name>
    <email>drogus@gmail.com</email>
  </author>
  <url>http://github.com/snusnu/dm-is-commentable/commit/064a2d398a4c30a90f2d398edc9a40a094a33f61</url>
  <id>064a2d398a4c30a90f2d398edc9a40a094a33f61</id>
  <committed-date>2009-02-02T17:59:47-08:00</committed-date>
  <authored-date>2009-01-07T03:07:33-08:00</authored-date>
  <message>Instance method commentable_class which returns class of commentable (i'm using it often and thought that Kernel.get_const on commentable_class_name in multiple could be moved to model)

Signed-off-by: Martin Gamsjaeger &lt;gamsnjaga@gmail.com&gt;</message>
  <tree>c835eee2b846864adf8cbfcccd61adc644002b44</tree>
  <committer>
    <name>Martin Gamsjaeger</name>
    <email>gamsnjaga@gmail.com</email>
  </committer>
</commit>
