Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Marshall errors for association collection callbacks

#2

Using the Proc based callbacks eg. has_many :somethings, :after_add => Proc.new{|r,something| something.do! } raises a marshall dump error ( procs can't be marshalled ) when a association collection is cached with the record.

Rewriting the callbacks to has_many :somethings, :after_add => :handle_adding_something bypasses this problem.

Perhaps it would be useful to catch this marshall error and raise a more informative exception.

Thougths?

Reported by Lourens Naude · April 15th, 2007 @ 12:19 AM

State: resolved
Milestone: acts_as_cached 2
Assigned to: Chris Wanstrath Chris Wanstrath

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • State changed from new to open
    • Assigned user set to Chris Wanstrath

    That's not a bad idea. Any ideas for language?

    April 15th, 2007 @ 12:19 AM

  2. Lourens Naude
    Lourens Naude

    http://pastie.caboo.se/50441 ... very much pseudocode, but its a start

    April 15th, 2007 @ 12:19 AM

  3. Chris Wanstrath
    Chris Wanstrath
    • Milestone set to acts_as_cached 2

    April 15th, 2007 @ 12:19 AM

  4. Chris Wanstrath
    Chris Wanstrath
    • State changed from open to resolved

    http://require.errtheblog.com/plugins/changeset/184

    That work for you? I'm closing the ticket, re-open if it needs more love.

    April 15th, 2007 @ 12:19 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.