I am trying to call two methods on an after create, but putting them into an array doesn’t work… i can’t find anything in the rails docs or google… anyone with experience?
after_create [:do_this, :do_that]
does not work
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No need to surround the methods in array. Simply use:
after_create :do_this, :and_then_thisBonus Information:
If a
before_*callback returns false, all the later callbacks and the associated action are cancelled. If anafter_*callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last.