Skip to content

Instantly share code, notes, and snippets.

@eastmedia
Created July 30, 2009 19:43
Show Gist options
  • Save eastmedia/158879 to your computer and use it in GitHub Desktop.
Save eastmedia/158879 to your computer and use it in GitHub Desktop.
>> u = User.first
=> #<AdminUser id: 2, email: "[email protected]", created_at: "2009-07-27 14:19:01", updated_at: "2009-07-29 21:17:36", crypted_password: "07d8e607d131e85a6b2090030b8198c278552878e10cef07a83...", password_salt: "y6xAKXoi5I8MMhn0A5KB", persistence_token: "c9a0865f8e5b6f135d21452deeeb4019ec9483cabb3f54bdac3...", single_access_token: "EHt4OIeX6_bCCHb96u0v", perishable_token: "8GYDF4gM7drerirRuNOz", login_count: 4, failed_login_count: 0, last_request_at: "2009-07-29 21:17:36", current_login_at: "2009-07-29 21:17:27", last_login_at: "2009-07-28 15:54:27", current_login_ip: "127.0.0.1", last_login_ip: "127.0.0.1", time_zone: "Eastern Time (US & Canada)", first_name: "Jacqui", last_name: "Maher", type: "AdminUser">
>> u.type = "User"
=> "User"
>> u.save
=> true
>> u
=> #<AdminUser id: 2, email: "[email protected]", created_at: "2009-07-27 14:19:01", updated_at: "2009-07-30 19:41:05", crypted_password: "07d8e607d131e85a6b2090030b8198c278552878e10cef07a83...", password_salt: "y6xAKXoi5I8MMhn0A5KB", persistence_token: "c9a0865f8e5b6f135d21452deeeb4019ec9483cabb3f54bdac3...", single_access_token: "EHt4OIeX6_bCCHb96u0v", perishable_token: "u7HNVwW_5IbpKITRhL-i", login_count: 4, failed_login_count: 0, last_request_at: "2009-07-29 21:17:36", current_login_at: "2009-07-29 21:17:27", last_login_at: "2009-07-28 15:54:27", current_login_ip: "127.0.0.1", last_login_ip: "127.0.0.1", time_zone: "Eastern Time (US & Canada)", first_name: "Jacqui", last_name: "Maher", type: "User">
>> u = User.first
=> #<User id: 2, email: "[email protected]", created_at: "2009-07-27 14:19:01", updated_at: "2009-07-30 19:41:05", crypted_password: "07d8e607d131e85a6b2090030b8198c278552878e10cef07a83...", password_salt: "y6xAKXoi5I8MMhn0A5KB", persistence_token: "c9a0865f8e5b6f135d21452deeeb4019ec9483cabb3f54bdac3...", single_access_token: "EHt4OIeX6_bCCHb96u0v", perishable_token: "u7HNVwW_5IbpKITRhL-i", login_count: 4, failed_login_count: 0, last_request_at: "2009-07-29 21:17:36", current_login_at: "2009-07-29 21:17:27", last_login_at: "2009-07-28 15:54:27", current_login_ip: "127.0.0.1", last_login_ip: "127.0.0.1", time_zone: "Eastern Time (US & Canada)", first_name: "Jacqui", last_name: "Maher", type: "User">
>> User.update_all ["type = ?", "AdminUser"]
=> 11
>> AdminUser.count
=> 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment