Skip to content

Instantly share code, notes, and snippets.

@brandur
Created April 24, 2012 03:50
Show Gist options
  • Save brandur/2476243 to your computer and use it in GitHub Desktop.
Save brandur/2476243 to your computer and use it in GitHub Desktop.
> u = User.first
=> #<User id: 23, email: "[email protected]", created_at: "2012-03-13 14:38:11", invited_by_id: nil, last_
login: "2012-03-13 14:39:46", reset_password_hash: nil, salt: nil, password_hash: nil, heroku_garden: nil, last_
git: nil, deleted_at: nil, payment_session_key: nil, confirmed_billing_info: nil, beta: nil, zendesk_created_at:
nil, verified_at: nil, billing_name: nil, billing_address: nil, billing_card: nil, invited_on: "2012-03-13 14:3
8:07", invite_converted_on: nil, pending_payment_session_key: nil, cached_usage_total: nil, confirmed_billing_at
: nil, max_apps: nil, api_key: "ca0ff390071bf08e038752154dd2c05533a810a9", signup_source_id: 6, rate_limit: nil,
first_name: nil, last_name: nil, invitation_secret: nil, password_hash_v2: "$2a$10$5PKpvQaDF2Lp0iGFl9KxKuoLO76s
4lMTFdizjxpgGqY4...", pref_site_version: nil, full_name: nil, accepted_tos_at: "2012-03-13 14:38:11", receive_ne
wsletter: false, suspended_at: nil, suspicious_since: nil>
u.valid?
u.errors.to_xml
>> u.valid?
=> false
u.errors.to_xml
>> u.errors.to_xml
=> "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<errors>\n <error>This is a base error</error>\n</errors>\n"
>> >> u.errors.to_json
=> "[[\"base\",\"This is a base error\"]]"
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment