On Nov 20, 9:11 am, Colin Law <[email protected]> wrote: > On 20 November 2010 07:25, Rajinder Yadav <[email protected]> wrote:
> Look carefully and you will see that t is an array, containing all > rows that match, though only one in this case. so you must do > t[0].name or t.first.name or similar. I am not sure why t.name > evaluates to "Ticket" though. Because it's not actually an array, it's a Arel scope and you can call class methods on such scopes (the method is called with conditions etc. set by the scope). In this case it's not very useful because the class method name just returns the name of the class but it still works. fred -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

