On Wed, Oct 7, 2009 at 11:11 AM, Joshua Muheim
<[email protected]> wrote:
> class Page < ActiveRecord::Base
>  def caption
>    caption ? caption : title
>  end
> end

This will produce an infinite loop.  I think you want something more like

self.caption ? self.caption : self.title

But honestly I'd rename the method to something else for clarity.



-- 
Greg Donald
http://destiney.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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to