<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -46,6 +46,15 @@ def send_to
     redirect_to destination_url
 end 
 
+Extra columns
+=============
+You can add extra application-specific columns to the events table if you like. To do so, modify
+the migration to include the columns after you run the add_event_table rake task and before you
+run the migration. Then you can pass a hash of extra options as part of the call to log_user_event:
+
+log_user_event &quot;In controller&quot;, &quot;http://example.com&quot;, &quot;27&quot;, {:user_id =&gt; 13, :product_id =&gt; 7}
+&lt;%= log_user_event &quot;In view&quot;, &quot;http://example.com&quot;, &quot;27&quot;, {:user_id =&gt; 13, :product_id =&gt; 7} %&gt;
+
 Gem installation
 ================
 If you are running rails 2.1 or above you can choose between a standard plugin install and a gem install. To</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,18 @@
 module UserEventLogger
   module UserEventLoggerMixin
-    def log_user_event(name, destination_url = nil, extra_data = nil)
+    def log_user_event(name, destination_url = nil, extra_data = nil, options = {})
       event = Event.create(:source_url =&gt; request.path,
        :destination_url =&gt; destination_url,
        :remote_ip =&gt; request.remote_ip,
        :logged_at =&gt; Time.now,
        :extra_data =&gt; extra_data,
        :event_type =&gt; name)
+      if !options.empty?
+        options.each do |key, value|
+          event.send(&quot;#{key.to_s}=&quot;, value)
+        end
+        event.save!
+      end
     end
   end
 end</diff>
      <filename>lib/user_event_logger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module UserEventLogger
   module UserEventLoggerViewHelper
-    def log_user_event(name, destination_url = nil, extra_data = nil)
+    def log_user_event(name, destination_url = nil, extra_data = nil, options = {})
       returning &quot;&quot; do |result|
         event = Event.create(:source_url =&gt; request.path,
          :destination_url =&gt; destination_url,
@@ -9,6 +9,12 @@ module UserEventLogger
          :extra_data =&gt; extra_data,
          :event_type =&gt; name
         )
+        if !options.empty?
+          options.each do |key, value|
+            event.send(&quot;#{key.to_s}=&quot;, value)
+          end
+          event.save!
+        end
       end
     end
   end</diff>
      <filename>lib/view_helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ ActiveRecord::Schema.define(:version =&gt; 0) do
     t.datetime &quot;logged_at&quot;
     t.text     &quot;extra_data&quot;
     t.string   &quot;event_type&quot;
+    t.string   &quot;extra_option&quot;
   end
     
 end</diff>
      <filename>test/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,5 +37,18 @@ class UserEventLoggerTest &lt; Test::Unit::TestCase
     assert_equal nil, e.extra_data
     assert_equal &quot;the name&quot;, e.event_type
   end
+
+  def test_log_user_event_with_extra_option
+    @controller.log_user_event &quot;the name&quot;, &quot;the destination URL&quot;, &quot;the extra data&quot;, {:extra_option =&gt; &quot;the extra option&quot;}
+    e = get_last_event
+    assert_equal &quot;the path&quot;, e.source_url
+    assert_equal &quot;the destination URL&quot;, e.destination_url
+    assert_equal &quot;the name&quot;, e.event_type
+    assert_equal &quot;the remote IP&quot;, e.remote_ip
+    assert_equal &quot;the extra data&quot;, e.extra_data
+    assert_equal &quot;the name&quot;, e.event_type
+    assert_equal &quot;the extra option&quot;, e.extra_option
+  end
+
 end
 </diff>
      <filename>test/user_event_logger_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,4 +38,17 @@ class ViewHelpersTest &lt; Test::Unit::TestCase
     assert_equal nil, e.extra_data
     assert_equal &quot;the name&quot;, e.event_type
   end
+  
+  def test_log_user_event_with_extra_option
+    @view.log_user_event &quot;the name&quot;, &quot;the destination URL&quot;, &quot;the extra data&quot;, {:extra_option =&gt; &quot;the extra option&quot;}
+    e = get_last_event
+    assert_equal &quot;the path&quot;, e.source_url
+    assert_equal &quot;the destination URL&quot;, e.destination_url
+    assert_equal &quot;the name&quot;, e.event_type
+    assert_equal &quot;the remote IP&quot;, e.remote_ip
+    assert_equal &quot;the extra data&quot;, e.extra_data
+    assert_equal &quot;the name&quot;, e.event_type
+    assert_equal &quot;the extra option&quot;, e.extra_option
+  end
+
 end
\ No newline at end of file</diff>
      <filename>test/view_helpers_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 Gem::Specification.new do |s|
   s.name     = &quot;user_event_logger&quot;
-  s.version  = &quot;0.4.2&quot;
-  s.date     = &quot;2008-08-28&quot;
+  s.version  = &quot;0.4.3&quot;
+  s.date     = &quot;2008-09-07&quot;
   s.summary  = &quot;Simple user-triggered event tracking for Rails&quot;
   s.email    = &quot;MikeG1@larkfarm.com&quot;
   s.homepage = &quot;http://github.com/ffmike/user_event_logger&quot;</diff>
      <filename>user_event_logger.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>18d7cd72fc13605edd682d345f685547fe3e0b67</id>
    </parent>
  </parents>
  <author>
    <name>Mike Gunderloy</name>
    <email>MikeG1@larkfarm.com</email>
  </author>
  <url>http://github.com/ffmike/user_event_logger/commit/6f0573d6a53f25abb40e223535f7f7816de5299b</url>
  <id>6f0573d6a53f25abb40e223535f7f7816de5299b</id>
  <committed-date>2008-09-07T09:29:45-07:00</committed-date>
  <authored-date>2008-09-07T09:29:45-07:00</authored-date>
  <message>Added ability to handle extra columns in the events table.</message>
  <tree>8b2151a5c1ef56aae396b6fae86f97217d246d92</tree>
  <committer>
    <name>Mike Gunderloy</name>
    <email>MikeG1@larkfarm.com</email>
  </committer>
</commit>
