Ruby on Rails Tuesday, June 29, 2010

On 29 June 2010 10:24, Carsten Gehling <lists@ruby-forum.com> wrote:
> class NilClass
>  def method_missing(method_name, *args)
>    ''
>  end
> end

Overloading method_missing is probable to cause more problems than it fixes :-)

> That works - if not pretty, then at least it holds my view code together
> while I fix it.

You only need to fix the missing associations one at a time; get a
MissingUser in there and all the nil users will disappear. Then if you
discover another nil association, create the MissingModel for that.

--
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@googlegroups.com.
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.

No comments:

Post a Comment