Hi. I need to figure out how to call expire_fragment from within a model. Seems to be a method which is not normally available to the model...? Situation is that I am feeding emails in via a MailReceiver model: class MyMailReceiver < ActionMailer::Base etc ... I''m using an external script to call something like "script/runner MyMailReceiver.receive(somedata)", and as a result of this call I need to then expire some page fragment cache items Any suggestions on how to make this happen? Should perhaps I not be pushing my email directly into the Model and instead via some controller...? Any other suggestions for how to accept external email into Rails? Cheers Ed W --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ed Wg wrote:> Hi. I need to figure out how to call expire_fragment from within a > model. Seems to be a method which is not normally available to the > model...? > > Situation is that I am feeding emails in via a MailReceiver model: > > class MyMailReceiver < ActionMailer::Base > etc ... > > I''m using an external script to call something like "script/runner > MyMailReceiver.receive(somedata)", and as a result of this call I need > to then expire some page fragment cache items > > Any suggestions on how to make this happen? Should perhaps I not be > pushing my email directly into the Model and instead via some > controller...? Any other suggestions for how to accept external email > into Rails? > > Cheers > > Ed Wtry: include ActionController::Caching::Fragments Long shot, but who knows. It''s probably better to include this in your script than the model itself, since the model itself should not know about caching. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> try: > > include ActionController::Caching::Fragments > > Long shot, but who knows. It''s probably better to include this in your > script than the model itself, since the model itself should not know > about caching. >Seems like the better thing is for the script to call a controller rather than a model directly? The example on the rails wiki talks directly to the model, but I think this feels like a bit of a hack really... Appreciate any thoughts... Cheers Ed W --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---