Topic: Transaction Validation Not Rendering Errors Partial

When I run my transaction, it doesn't throw my errors partial displaying that amount can't be string characters, they have to be integers. Not sure why this is the case, any ideas? My errors works on my other controllers, but on my transaction code.


Console Output

 ActiveRecord::RecordInvalid in PaymentsController#create
 
Validation failed: Amount is not a number
Rails.root: /Users/telagraphic/Documents/programming/rails_projects/life-ulator
 
Application Trace | Framework Trace | Full Trace
app/models/payment.rb:9:in `save_and_update'
app/controllers/payments_controller.rb:8:in `create'
Request
 
Parameters:
 
{"utf8"=>"✓",
 "authenticity_token"=>"4pxlp8J/lb21CW2z7W7wuFVfnClOfGdtbARXstoUisE=",
 "payment"=>{"amount"=>"asdf"},
 "commit"=>"+payment",
 "debt_id"=>"6"}
Payments Controller

  def create
    @debt = current_user.debts.find params[:debt_id]
    @payment = @debt.payments.build params[:payment]
    @payment.user_id = current_user.id
    if @payment.save_and_update(@debt)
      redirect_to @debt
    else
      render 'debts/show'
    end
  end

Payment Model
  attr_accessible :amount
  
  validates :amount, presence: true, :numericality => true
  
  belongs_to :debt
  
  def save_and_update(debt)
    self.transaction do
      self.save
      debt.update_attributes(amount: debt.amount - self.amount)
    end
  end

Routes

  resources :debts do
    resources :payments
  end