From c240fb0d837f871abeb23d2b0df3050b1ea84df5 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 20 Mar 2014 15:35:30 +1100 Subject: [PATCH] BUGFIX: facebook does not always provide username We key on facebook_user_id its the only thing that matters --- app/models/facebook_user_info.rb | 3 +-- ...20140320042653_facebook_user_infos_username_can_be_nil.rb | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20140320042653_facebook_user_infos_username_can_be_nil.rb diff --git a/app/models/facebook_user_info.rb b/app/models/facebook_user_info.rb index b0c0a8123..8ef00720e 100644 --- a/app/models/facebook_user_info.rb +++ b/app/models/facebook_user_info.rb @@ -9,7 +9,7 @@ end # id :integer not null, primary key # user_id :integer not null # facebook_user_id :integer not null -# username :string(255) not null +# username :string(255) # first_name :string(255) # last_name :string(255) # email :string(255) @@ -24,4 +24,3 @@ end # index_facebook_user_infos_on_facebook_user_id (facebook_user_id) UNIQUE # index_facebook_user_infos_on_user_id (user_id) UNIQUE # - diff --git a/db/migrate/20140320042653_facebook_user_infos_username_can_be_nil.rb b/db/migrate/20140320042653_facebook_user_infos_username_can_be_nil.rb new file mode 100644 index 000000000..358467203 --- /dev/null +++ b/db/migrate/20140320042653_facebook_user_infos_username_can_be_nil.rb @@ -0,0 +1,5 @@ +class FacebookUserInfosUsernameCanBeNil < ActiveRecord::Migration + def change + change_column "facebook_user_infos", :username, :string, null: true + end +end