<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -56,7 +56,7 @@ class FeedEvent &lt; ActiveRecord::Base
   private
   
   def source_disabled_event?
-    source.respond_to?(:user) &amp;&amp; source.user &amp;&amp; !source.user.feed_event_enabled?(self.class)
+    self.class.user_can_enable_event? &amp;&amp; source.respond_to?(:user) &amp;&amp; source.user &amp;&amp; !source.user.feed_event_enabled?(self.class)
   end
   def send_email
     FeedEventMailer.send &quot;deliver_#{self.class.name.underscore[0..-7]}&quot;, self if self.class.can_send_email? &amp;&amp; 
@@ -75,8 +75,7 @@ class FeedEvent &lt; ActiveRecord::Base
   end
   
   def source_user_has_event_enabled
-    errors.add :source, &quot;this event is disabled by the user of #{self.source.class}&quot; if self.class.user_can_enable_event? &amp;&amp; 
-      source_disabled_event?
+    errors.add :source, &quot;this event is disabled by the user of #{self.source.class}&quot; if source_disabled_event?
   end
   
 end</diff>
      <filename>lib/feed_event.rb</filename>
    </modified>
    <modified>
      <diff>@@ -90,7 +90,7 @@ describe 'check event enabled when sending email' do
   
   before(:each) do
     TestFeedEvent.connection.stub!(:insert)
-    FeedEventMailer.stub!(:send).with(:new).and_return(stub('mailer', :test_feed =&gt; true))
+    FeedEventMailer.stub!(:send).with(:new).and_return(stub('mailer', :test_feed =&gt; true, :not_disabable =&gt; true))
     @user = mock_model(User, :subscribed_to_feed_event? =&gt; true, :subscribed_to_email? =&gt; true)
     Source.stub!(:base_class).and_return(Source)
     @source = mock_model(Source, :user =&gt; @user)
@@ -109,9 +109,9 @@ describe 'check event enabled when sending email' do
     @event.save
   end
   
-  it &quot;should send no email if user can't enable event&quot; do
-    event = NotDisabableEvent.new :source =&gt; @user, :user =&gt; @user
-    FeedEventMailer.should_receive(:send).with('not_disabable', event).never
+  it &quot;should send email if user can't disable event&quot; do
+    event = NotDisabableEvent.new :source =&gt; @source, :user =&gt; @user
+    FeedEventMailer.should_receive(:send).with('deliver_not_disabable', event)
     event.save
   end
 end</diff>
      <filename>spec/models/feed_event_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e3a60b1da6752d6448121625a3d554f8d7d2f30f</id>
    </parent>
  </parents>
  <author>
    <name>Thilo</name>
    <email>thilo@Silverchest.local</email>
  </author>
  <url>http://github.com/langalex/social_feed/commit/5690c7e77960c3a1209716e615c89136095417de</url>
  <id>5690c7e77960c3a1209716e615c89136095417de</id>
  <committed-date>2008-08-27T18:08:12-07:00</committed-date>
  <authored-date>2008-08-27T18:08:12-07:00</authored-date>
  <message>fixed that the feed event don't send emails if the source user can't disable the feed event</message>
  <tree>279979f0dd1435b65bea45b5b4533beb5120d2f5</tree>
  <committer>
    <name>Thilo</name>
    <email>thilo@Silverchest.local</email>
  </committer>
</commit>
