【发布时间】:2016-01-19 11:59:08
【问题描述】:
我有一个 ActiveRecord::Relation between:
订单类别:
has_many :transactions, :class_name => "OrderTransaction" 和
OrderTransaction 类:
belongs_to :order
serialize :params
ActiveRecord::Relation [#OrderTransaction id: 5, order_id: 11, action: "purchase", amount: 26044, success: true, authentication: "8V863650823585301", message: "Success", params: {"timestamp" =>“2015-10-16T23:11:09Z”、“ack”=>“成功”、“correlation_id”=>“9b5eb7051dbe3”、“版本”=>“72”、“构建”=>“18308778”、 "amount"=>"260.44", "amount_currency_id"=>"USD", "avs_code"=>"X", "cvv2_code"=>"M", "transaction_id"=>"8V863650823585301", "Timestamp"=> "2015-10-16T23:11:09Z", "Ack"=>"Success", "CorrelationID"=>"9b5eb7051dbe3", "Version"=>"72", "Build"=>"18308778", "金额"=>"260.44", "AVSCode"=>"X", "CVV2Code"=>"M", "TransactionID"=>"8V863650823585301"}, created_at: "2015-10-16 23:11:09",更新时间:“2015-10-16 23:11:09”]
我正在尝试在 irb 控制台中打印 params[:transaction_id] 但我找不到正确的方法来执行此操作。有什么想法吗?
【问题讨论】:
标签: ruby-on-rails activerecord