rubyonrailsin

A Ruby and Rails talk

Thursday, March 18, 2010


[spree-user] Checkout update_hook append

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

The documentation says you can do this:

delivery.edit_hook << :perform_additional_logic


But when I do that like so:

confirm.update_hook << :my_nifty_hook
def my_nifty_hook
raise "I'm hooked!"
end

I get an exception:

You have a nil object when you didn't expect it! (NoMethodError)
You might have expected an instance of Array.
The error occurred while evaluating nil.<<

When I look at the code for hooks, I don't see how you can append. Is
this a nice idea that has not yet been implemented. (I'm on edge.)

Alan Gutierrez

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree-user@googlegroups.com.
To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive