Sunday, January 30, 2011

[Rails] Re: Access parent object instance variable

On Jan 30, 12:51 am, "Ellicks M." <li...@ruby-forum.com> wrote:
> I want to be able to loop over all the event_occurrences and access the
> data of the parent event.  At the moment I'm doing this via something
> like:
>
>    ObjectSpace._id2ref(@parent_event_object_id).title
>
> but this is sometimes returning RangeError(xxx is a recycled object).
> Assumedly the parent objects are being garbage collected.
>
> Does anybody have any suggestions on how this could be done correctly?

Why could events not have an array of the dates on which they occur
(or indeed, why do occurrences need to exist ahead of time - it seems
that Event could have a method that given a range of dates computes
all the occurrences for that range)

Fred
>
> --
> Posted viahttp://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@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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate