Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Spring cleaning: remove user records where github_id is nil (related to
Browse files Browse the repository at this point in the history
#979)

For real github accounts, the github_id is not nil. So if the id is nil, it is a fake account or an input error.
Updated seeds with github_id
  • Loading branch information
emcoding committed May 24, 2018
1 parent 5766aff commit b8a047c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class DestroyNonExistingGitHubUsers < ActiveRecord::Migration[5.1]
def up
execute 'DELETE FROM users WHERE github_id IS NULL'
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20180514195656) do
ActiveRecord::Schema.define(version: 20180524190818) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down
1 change: 1 addition & 0 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FactoryBot.define do
factory :user, aliases: [:member] do
github_handle { FFaker::InternetSE.unique.user_name_variant_short }
sequence(:github_id, 123)
name { FFaker::Name.name }
email { FFaker::Internet.email }
location { FFaker::Address.city }
Expand Down

0 comments on commit b8a047c

Please sign in to comment.