<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -32,18 +32,7 @@ or, if you want to register some events:
 	&lt;% end %&gt;
 
 As you can see, this will hit your database up to 31 times (one hit for each 
-day) if you don't optimize it. Fortunately, you can use the ActiveRecord method
-`has_calendar`:
-
-	class Schedule &lt; ActiveRecord::Base
-	  has_calendar :created_at
-	end
-
-This call inserts a new method `to_calendar` that gets the attribute
-`created_at` and converts it using the `to_s(:number)` date method. This method
-is used to group all records that are passed as the option `:events`. So,
-instead of receiving a date, you receive a date plus all the records for that 
-specific day. Your view will look like this:
+day) if you don't optimize it. Fortunately, you can use the options `:events`:
 
 	&lt;% calendar :events =&gt; Schedule.all do |date, events| %&gt;
 		&lt;% for event in events %&gt;
@@ -51,6 +40,16 @@ specific day. Your view will look like this:
 		&lt;% end %&gt;
 	&lt;% end %&gt;
 
+By default, each record will use the `created_at` attribute as date grouping. 
+You can specify a different attribute with the option `:field`:
+
+	&lt;% calendar :events =&gt; Schedule.all, :field =&gt; :scheduled_at do |date, events| %&gt;
+		&lt;!-- do something --&gt;
+	&lt;% end %&gt;
+
+Formatting the calendar
+-----------------------
+
 You can use this CSS to start:
 
 	#calendar {</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 require File.dirname(__FILE__) + &quot;/lib/has_calendar&quot;
 require &quot;stringio&quot;
 
-ActiveRecord::Base.send :include, SimplesIdeias::Calendar::ActiveRecord
 ActionView::Base.send :include, SimplesIdeias::Calendar::ActionView
\ No newline at end of file</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,38 +1,13 @@
 module SimplesIdeias
   module Calendar
-    module ActiveRecord
-      def self.included(base)
-        base.extend ClassMethods
-        
-        class &lt;&lt; base
-          attr_accessor :has_calendar_options
-        end
-      end
-      
-      module ClassMethods
-        def has_calendar(attribute = :created_at)
-          include SimplesIdeias::Calendar::ActiveRecord::InstanceMethods
-          
-          self.has_calendar_options = {
-            :attribute =&gt; attribute
-          }
-        end
-      end
-      
-      module InstanceMethods
-        def to_calendar
-          @to_calendar ||= send(self.class.has_calendar_options[:attribute]).to_date.to_s(:number)
-        end
-      end
-    end
-    
     module ActionView
       def calendar(options={}, &amp;block)
         options = {
           :year =&gt; Date.today.year,
           :month =&gt; Date.today.month,
           :today =&gt; 'Today',
-          :events =&gt; nil
+          :events =&gt; nil,
+          :field =&gt; :created_at
         }.merge(options)
       
         cmd = 'cal '
@@ -56,13 +31,15 @@ module SimplesIdeias
         end
         
         # group all records if data is provided
-        records = {}
-        
         if options[:events]
-          options[:events].each do |record|
-            records[record.to_calendar] ||= []
-            records[record.to_calendar] &lt;&lt; record
+          records = options[:events].inject({}) do |memo, record|
+            stamp = record.send(options[:field]).to_date.to_s(:number)
+            memo[stamp] ||= []
+            memo[stamp] &lt;&lt; record
+            memo
           end
+          
+          debugger
         end
       
         # building the calendar</diff>
      <filename>lib/has_calendar.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>134cea63b138cbd0c534a6947183cc9d5aac2ad3</id>
    </parent>
  </parents>
  <author>
    <name>Nando Vieira</name>
    <email>fnando.vieira@gmail.com</email>
  </author>
  <url>http://github.com/fnando/has_calendar/commit/000f44e43424723867a3137859506cff1ba1e05e</url>
  <id>000f44e43424723867a3137859506cff1ba1e05e</id>
  <committed-date>2008-09-18T05:39:56-07:00</committed-date>
  <authored-date>2008-09-18T05:39:56-07:00</authored-date>
  <message>Removed ActiveRecord dependency; specify the attribute name with the option :field.</message>
  <tree>c4a70c9b808da5a091446663818fc473fde8948e</tree>
  <committer>
    <name>Nando Vieira</name>
    <email>fnando.vieira@gmail.com</email>
  </committer>
</commit>
