On 6/28/07, Brandon Keepers <[EMAIL PROTECTED]> wrote:
> Nice, but IMHO, this would be more useful:
>
> class Company < AR::Base
>    def to_s
>      name
>    end
> end

+1!

I'm using the same pattern too.

Shouldn't this be encouraged? It's a way of saying: you should provide
a human-readable representation of your object (yeah, usually just
alias name).

I do find link_to @company.name, @company very unDRY... and even more
when it gets duplicated all over the place...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to