It finally worked, with this patch:

class ActionMailer::ARMailer < ActionMailer::Base

  def perform_delivery_activerecord(mail)
    mail.destinations.each do |destination|
      Email.create :mail => mail.encoded, :to => destination, :from =>
mail.from.first
    end
  end

end

and ar_mailer 1.4


On Jul 16, 12:51 pm, Alejandro <[email protected]> wrote:
> Hi again,
>
> I'm using ar_mailer in my notifier and it works perfect. Since I've
> updated to CE Edge and rails 2.3.2 it stopped working.
> I read different post about the issues of ar_mailer and rails 2.3.2,
> so I end up trying to use the adzap-ar_mailer gem instead of the
> ar_mailer one.
> The problem is that when I start the web server I can send one email
> using the notifier, but when I try to send another mail I get the
> annoying error:
>
> TypeError (can't dup NilClass):
>   vendor/plugins/community_engine/app/models/message.rb:18:in
> `notify_recipient'
>   vendor/plugins/community_engine/app/controllers/
> messages_controller.rb:38:in `create'
>   /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
>   /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
>   /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
>   /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
>   /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
>   /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
>   /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
>   /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
>   /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
>   /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
>
> I found in some posts that this is a unloading problem, which should
> probably be solved with this lines in development.rb:
>
> config.after_initialize do
>     ActiveSupport::Dependencies.load_once_paths =
>     ActiveSupport::Dependencies.load_once_paths.select {|path| (path
> =~/(community_engine)/).nil? }
> end
>
> but that doesn't fix the problem.
>
> I tried several things:
>
> 1) change the ./vendor/plugins/community_engine/app/models/
> user_notifier.rb to extend ar_mailer
> 2) delete my user_notifier
> 3) leave my user_notifier and delete the CE user_notifier
>
> Nothing of this worked.
>
> One thing I noticed is that when I put this line:
>
>   config.gem "adzap-ar_mailer", :lib => 'action_mailer/
> ar_mailer', :version => 'http://gems.github.com'
>
>  in environment.rb  instead of:
>
> require 'action_mailer/ar_mailer'
>
> as adzap-ar_mailer doc says the webserver doesn't start.
>
> The other thing I did is dropping an init file ar_mailer_patch.rb:
>
> class ActionMailer::Base
>
>   def perform_delivery_activerecord(mail)
>     mail.destinations.each do |destination|
>       Email.create :mail => mail.encoded, :to => destination, :from =>
> mail.from.first
>     end
>   end
>
> end
>
> that it's supposed to fix the problem, but nothing.
>
> Sorry if my post if messy, any help will be appreciated.
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CommunityEngine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/communityengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to