Skip to content

Instantly share code, notes, and snippets.

@franzejr
Last active August 29, 2015 13:56
Show Gist options
  • Save franzejr/8954754 to your computer and use it in GitHub Desktop.
Save franzejr/8954754 to your computer and use it in GitHub Desktop.
User error
[21] sharewizz(main)> User.create(id:3989,first_name: "Francisco", last_name:"Lins",terms:true,name:"FranzeJr2", email:"email@gmail.com",password:"password")
(0.2ms) BEGIN
User Load (14.2ms) SELECT `users`.* FROM `users` WHERE `users`.`email` = 'email@gmail.com' LIMIT 1
User Load (10.5ms) SELECT `users`.* FROM `users` WHERE `users`.`confirmation_token` = '2df949add7a9e970ff949066f5a6b7105fa42a1c19ea7d245cb54b71f5f1eef5' LIMIT 1
SQL (0.9ms) INSERT INTO `users` (`activated`, `authentication_token`, `bio`, `chat_enabled`, `checked_messages_at`, `checked_notifications_at`, `checked_wizzes_at`, `confirmation_sent_at`, `confirmation_token`, `confirmed_at`, `connected`, `created_at`, `current_sign_in_at`, `current_sign_in_ip`, `deleted_at`, `delta`, `email`, `encrypted_password`, `first_name`, `is_admin`, `is_company`, `language`, `last_name`, `last_sign_in_at`, `last_sign_in_ip`, `name`, `nb_objects`, `password_salt`, `picture`, `rating_average`, `remember_created_at`, `reset_password_sent_at`, `reset_password_token`, `sign_in_count`, `status`, `survey_sent_at`, `terms`, `terms_accepted_at`, `updated_at`, `zipcode`) VALUES (0, NULL, NULL, 1, '2012-06-07 16:24:21', '2012-06-07 16:24:20', NULL, '2014-02-12 12:37:34', '2df949add7a9e970ff949066f5a6b7105fa42a1c19ea7d245cb54b71f5f1eef5', NULL, 0, '2014-02-12 12:37:34', NULL, NULL, NULL, 1, 'email@gmail.com', '$2a$10$.qUiv/usmJ68h1D/5xLgguAgPFD8U9AD5E9D1mTze45kApvd/jtMy', 'Francisco', 0, 0, NULL, 'Lins', NULL, NULL, 'FranzeJr2', 0, NULL, NULL, 0.0, NULL, NULL, NULL, 0, 'available', NULL, 1, NULL, '2014-02-12 12:37:34', NULL)
SQL (0.3ms) INSERT INTO `versions` (`created_at`, `event`, `item_id`, `item_type`, `locale`, `object`, `whodunnit`) VALUES ('2014-02-12 12:37:34', 'create', 4127, 'User', 'en', NULL, NULL)
Page Load (0.5ms) SELECT `pages`.* FROM `pages` WHERE `pages`.`permalink` = 'cgu' LIMIT 1
Page::Translation Load (0.5ms) SELECT `page_translations`.* FROM `page_translations` WHERE `page_translations`.`page_id` = 5
Version Load (0.5ms) SELECT `versions`.* FROM `versions` WHERE `versions`.`item_id` = 9 AND `versions`.`item_type` = 'Page::Translation' ORDER BY created_at DESC, id DESC LIMIT 1
(21.5ms) ROLLBACK
RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
from /Users/franzejr/programming/Sharewizz/webapp/app/models/user.rb:175:in `track_terms'
[22] sharewizz(main)>
@franzejr
Copy link
Author

[21] sharewizz(main)> User.create(id:3989,first_name: "Francisco", last_name:"Lins",terms:true,name:"FranzeJr2", email:"email@gmail.com",password:"password")
(0.2ms) BEGIN
User Load (14.2ms) SELECT users.* FROM users WHERE users.email = 'email@gmail.com' LIMIT 1
User Load (10.5ms) SELECT users.* FROM users WHERE users.confirmation_token = '2df949add7a9e970ff949066f5a6b7105fa42a1c19ea7d245cb54b71f5f1eef5' LIMIT 1
SQL (0.9ms) INSERT INTO users (activated, authentication_token, bio, chat_enabled, checked_messages_at, checked_notifications_at, checked_wizzes_at, confirmation_sent_at, confirmation_token, confirmed_at, connected, created_at, current_sign_in_at, current_sign_in_ip, deleted_at, delta, email, encrypted_password, first_name, is_admin, is_company, language, last_name, last_sign_in_at, last_sign_in_ip, name, nb_objects, password_salt, picture, rating_average, remember_created_at, reset_password_sent_at, reset_password_token, sign_in_count, status, survey_sent_at, terms, terms_accepted_at, updated_at, zipcode) VALUES (0, NULL, NULL, 1, '2012-06-07 16:24:21', '2012-06-07 16:24:20', NULL, '2014-02-12 12:37:34', '2df949add7a9e970ff949066f5a6b7105fa42a1c19ea7d245cb54b71f5f1eef5', NULL, 0, '2014-02-12 12:37:34', NULL, NULL, NULL, 1, 'email@gmail.com', '$2a$10$.qUiv/usmJ68h1D/5xLgguAgPFD8U9AD5E9D1mTze45kApvd/jtMy', 'Francisco', 0, 0, NULL, 'Lins', NULL, NULL, 'FranzeJr2', 0, NULL, NULL, 0.0, NULL, NULL, NULL, 0, 'available', NULL, 1, NULL, '2014-02-12 12:37:34', NULL)
SQL (0.3ms) INSERT INTO versions (created_at, event, item_id, item_type, locale, object, whodunnit) VALUES ('2014-02-12 12:37:34', 'create', 4127, 'User', 'en', NULL, NULL)
Page Load (0.5ms) SELECT pages.* FROM pages WHERE pages.permalink = 'cgu' LIMIT 1
Page::Translation Load (0.5ms) SELECT page_translations.* FROM page_translations WHERE page_translations.page_id = 5
Version Load (0.5ms) SELECT versions.* FROM versions WHERE versions.item_id = 9 AND versions.item_type = 'Page::Translation' ORDER BY created_at DESC, id DESC LIMIT 1
(21.5ms) ROLLBACK
RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
from /Users/franzejr/programming/Sharewizz/webapp/app/models/user.rb:175:in `track_terms'
[22] sharewizz(main)>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment