rail 3+ activemerchant: Get data from association class

Hi

I'm using ActiveMerchant with Authorize.net and already setup 2 models Order and Transaction. (#145 Integrating Active Merchant - RailsCasts active-merchant)

I would like to get error message from the transaction if error occurred then output in flash message. Here is my code:

#models/order_transaction.rb

class OrderTransaction < ActiveRecord::Base   belongs_to :order   serialize :params

  def response=(response)     self.success = response.success?     self.authorization = response.authorization     self.message = response.message     self.params = response.params   rescue ActiveMerchant::ActiveMerchantError => e     self.success = false     self.authorization = nil     self.message = e.message     self.params = {}   end end

How do I get those data from OrderTransaction class such as message, success... in order_controller?

Thank you!