I read these: http://www.ruby-forum.com/topic/185297#new http://www.freezzo.com/2008/05/14/override-default-find-conditions-for-model/ it works, it override the .find perfectly, however it does not cover .find_by_id or other .find_by_XXX Is there anyway to override all the find function of a modal? I want to set the default "select" for User modal, only return name and id, but not the password by default. Thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Dec 28, 9:54 am, Leonardo Wong <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I read these:http://www.ruby-forum.com/topic/185297#newhttp://www.freezzo.com/2008/05/14/override-default-find-conditions-fo... > > it works, it override the .find perfectly, however it does not cover > .find_by_id or other .find_by_XXX > > Is there anyway to override all the find function of a modal? I want to > set the default "select" for User modal, only return name and id, but > not the password by default. >default_scope ? The methods linked above should also work in recent versions of rails - find_by_xxx used to call find_every/find_initial directly but now calls find. Fred> Thanks > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks! I am using a very old version rails... thats why it does not work... I tested on new version rails and it works, happy now =) Leonardo Frederick Cheung wrote:> On Dec 28, 9:54�am, Leonardo Wong <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> I read these:http://www.ruby-forum.com/topic/185297#newhttp://www.freezzo.com/2008/05/14/override-default-find-conditions-fo... >> >> it works, it override the .find perfectly, however it does not cover >> .find_by_id or other .find_by_XXX >> >> Is there anyway to override all the find function of a modal? I want to >> set the default "select" for User modal, only return name and id, but >> not the password by default. >> > > default_scope ? > > The methods linked above should also work in recent versions of rails > - find_by_xxx used to call find_every/find_initial directly but now > calls find. > > Fred >> Thanks >> -- >> Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.