<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/object_extensions.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-require 'if_not_nil'
+require 'object_extensions'
 
 # configuration
 require 'ostruct'</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ class FeedEvent &lt; ActiveRecord::Base
   private
   def send_email
     FeedEventMailer.send &quot;deliver_#{self.class.name.underscore[0..-7]}&quot;, self if self.class.can_send_email? &amp;&amp; 
-      (user.subscribed_to_email?(self.class) || self.class.user_cannot_subscribe_to_event?) &amp;&amp; !user.online?
+      (user.subscribed_to_email?(self.class) || self.class.user_cannot_subscribe_to_event?) &amp;&amp; !user.try(:online?)
   end
   
   def self.load_subclasses</diff>
      <filename>lib/feed_event.rb</filename>
    </modified>
    <modified>
      <diff>@@ -136,6 +136,11 @@ describe FeedEvent, 'check subscription before sending emails' do
     TestFeedEvent.create :user =&gt; @user
   end
   
+  it &quot;should send an email user user subscribed to email and has no online method&quot; do
+    FeedEventMailer.should_receive(:send).with('deliver_test_feed', anything)
+    TestFeedEvent.create :user =&gt; mock_model(User, :subscribed_to_email? =&gt; true, :subscribed_to_feed_event? =&gt; false)
+  end
+  
   it &quot;should check the subscription of the user&quot; do
     @user.should_receive(:subscribed_to_email?).with(TestFeedEvent).and_return(false)
     TestFeedEvent.create :user =&gt; @user</diff>
      <filename>spec/models/feed_event_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@ class FeedEventMailer; end
 require File.dirname(__FILE__) + '/../generators/social_feed_migration/templates/migration'
 AddSocialFeed.up
 
-require PLUGIN_ROOT + '/lib/if_not_nil'
+require PLUGIN_ROOT + '/lib/object_extensions'
 
 
 # rspec rails stuff</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/if_not_nil.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>42613fb213fe912bbc1733d4b616fa9e2a0db8b9</id>
    </parent>
  </parents>
  <author>
    <name>Alexander Lang</name>
    <email>alex@skywalker.(none)</email>
  </author>
  <url>http://github.com/langalex/social_feed/commit/332d458a4b144fd0c2f2219272517992c5998a3a</url>
  <id>332d458a4b144fd0c2f2219272517992c5998a3a</id>
  <committed-date>2008-04-28T02:16:54-07:00</committed-date>
  <authored-date>2008-04-28T02:16:54-07:00</authored-date>
  <message>previously the email sending required the user to have a online? method (no emails if user is online), this is now optional</message>
  <tree>5960f818fde3393b9e02899871ac9a955b40f339</tree>
  <committer>
    <name>Alexander Lang</name>
    <email>alex@skywalker.(none)</email>
  </committer>
</commit>
