Hello, I have a custom library in lib that handles remote authentication to our external auth system via soap. All works well from the controller. However, I feel all this logic should be moved to the model but I dont know how to invoke a method in a library Module from a model. Is this possible? Last resort is to move this logic into the controller, but that just seems to break MVC Thx Adam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, Authentication generally isn''t a domain responsibility. Thus, I wouldn''t put something like that in a model. Also, the authentication logic itself probably doesn''t belong in the controller. Rather, the controller can invoke a method on the lib to authenticate the user. If this is what you''re doing already, what''s bothering you about it? Craig --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I guess more because I am used to the authenticate methods being in the model with restful_authentication , etc. Currently using a lib file loaded into a controller and calling a method from there, so I guess we are OK. Felt strange for some reason. Adam On Thu, Jun 5, 2008 at 10:37 PM, Craig Demyanovich <cdemyanovich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > Authentication generally isn''t a domain responsibility. Thus, I > wouldn''t put something like that in a model. Also, the authentication > logic itself probably doesn''t belong in the controller. Rather, the > controller can invoke a method on the lib to authenticate the user. If > this is what you''re doing already, what''s bothering you about it? > > Craig > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---