Skip to content

Instantly share code, notes, and snippets.

@spockz
Created July 3, 2010 10:39
Show Gist options
  • Select an option

  • Save spockz/462495 to your computer and use it in GitHub Desktop.

Select an option

Save spockz/462495 to your computer and use it in GitHub Desktop.
Transaction.find(1).id
=>1
YAML::dump(Transaction.find(1).detail)
=>--- !ruby/object:Transaction::Detail attributes: subscription_plan_name: foobar payment_method: visa feature_level: foobar recurring: true prefix_options: {}
Transaction.find(1).detail.payment_method
=> undefined method `payment_method' for #<Transaction::Detail:0x103e28a70>
Transaction.find(1).detail.attributes.payment_method
=> undefined method `payment_method' for #<Hash:0x103ef2bb8>
Transaction.find(1).detail.attributes[:payment_method]
=> nil
(transaction.detail.attributes['payment_method'])
=> visa
# I thought symbols would evaluate to strings in rails?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment