Marshall errors for association collection callbacks
Reported by Lourens Naude | April 15th, 2007 @ 12:19 AM | in acts_as_cached 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?
Comments and changes to this ticket
-
Chris Wanstrath April 15th, 2007 @ 12:19 AM
- State changed from new to open
- Assigned user set to Chris Wanstrath
That's not a bad idea. Any ideas for language?
-
Lourens Naude April 15th, 2007 @ 12:19 AM
http://pastie.caboo.se/50441 ... very much pseudocode, but its a start
-
Chris Wanstrath April 15th, 2007 @ 12:19 AM
- Milestone set to acts_as_cached 2
-
Chris Wanstrath April 15th, 2007 @ 12:19 AM
- 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.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป