This is really strange:>> User.send(:merge_joins, "one", "two")=> ["one", "two"]>> User.respond_to?(:merge_joins)=> false Am I missing something here? Shouldn''t the respond_to return true? thanks for your help -- 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 -~----------~----~----~----~------~----~------~--~---
On 15 Oct 2008, at 21:33, Ben Johnson <rails-mailing-list@andreas- s.net> wrote:> > This is really strange: > >>> User.send(:merge_joins, "one", "two") > => ["one", "two"] >>> User.respond_to?(:merge_joins) > => false > > Am I missing something here? Shouldn''t the respond_to return true? >By default respond_to returns false if a method is private (such as merge_joins) but send ignores privateness and protectedness Fred> thanks for your help > -- > 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 -~----------~----~----~----~------~----~------~--~---
On Oct 15, 3:33 pm, Ben Johnson <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> This is really strange: > > >> User.send(:merge_joins, "one", "two") > => ["one", "two"] > >> User.respond_to?(:merge_joins) > > => false > > Am I missing something here? Shouldn''t the respond_to return true? > > thanks for your help > -- > Posted viahttp://www.ruby-forum.com/.If User is actually using method_missing to handle the merge_joins message, then respond_to? won''t be able to see it. Jeff purpleworkshops.com softiesonrails.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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---