self.eligibility_for_rebate = decide_eligibility end def ensure_credit_card_is_on_file puts "check if credit card is on file" end end Order.create! => ActiveRecord::RecordNotSaved: ActiveRecord::RecordNotSaved
self.eligibility_for_rebate = decide_eligibility end def ensure_credit_card_is_on_file puts "check if credit card is on file" end end Order.create! => check if credit card is on file => <Order id: 4, eligibility_for_rebate: false>
self.eligibility_for_rebate = decide_eligibility throw(:abort) end def ensure_credit_card_is_on_file puts "check if credit card is on file" end end Order.create! => ActiveRecord::RecordNotSaved: Failed to save the record