{"comment":{"url":"https://api.github.com/repos/goofiw/contacts/comments/11185848","html_url":"https://github.com/goofiw/contacts/commit/4c86ddbcdcfc7bb69620645fc19233f8104269de#commitcomment-11185848","id":11185848,"user":{"login":"monicao","id":165790,"avatar_url":"https://avatars.githubusercontent.com/u/165790?v=3","gravatar_id":"","url":"https://api.github.com/users/monicao","html_url":"https://github.com/monicao","followers_url":"https://api.github.com/users/monicao/followers","following_url":"https://api.github.com/users/monicao/following{/other_user}","gists_url":"https://api.github.com/users/monicao/gists{/gist_id}","starred_url":"https://api.github.com/users/monicao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monicao/subscriptions","organizations_url":"https://api.github.com/users/monicao/orgs","repos_url":"https://api.github.com/users/monicao/repos","events_url":"https://api.github.com/users/monicao/events{/privacy}","received_events_url":"https://api.github.com/users/monicao/received_events","type":"User","site_admin":false},"position":16,"line":23,"path":"main.rb","commit_id":"4c86ddbcdcfc7bb69620645fc19233f8104269de","created_at":"2015-05-13T21:40:13Z","updated_at":"2015-05-13T21:40:13Z","body":"If the user enters the wrong column name the insert statement would fail. Might be good to offer the user a list of columns to choose from. Ex.\r\n\r\n```ruby\r\n# somewhere outside your method\r\nCOLUMN_OPTIONS = ['first_name', 'last_name', 'email']\r\n\r\n# in get_update_params\r\nask_for_column = true\r\nwhile ask_for_column\r\n  puts \"what would you like to update?  Enter 1: first name, 2: last name, 3: email\"\r\n  option_id = STDIN.gets.chomp.to_i\r\n  if option_id < 1 || option_id >= COLUMN_OPTIONS.length\r\n    column = COLUMN_OPTIONS[option_id]\r\n  else\r\n    puts \"invalid option.\"\r\n  end\r\nend\r\n```"}}