@tomhughes commented on this pull request.

In addition to the inline comments I think there's probably scope here for 
tidying up the commit history as there seem to be cases here where later 
commits are fixing up earlier ones?

> +
+def create_user(display_name:, password:, email:, admin: false)
+  user = User.find_or_create_by!(:display_name => display_name) do |record|
+    record.email = email
+    record.pass_crypt = password
+    record.pass_crypt_confirmation = password
+    record.tou_agreed = Time.now.utc
+    record.terms_seen = true
+    record.terms_agreed = Time.now.utc
+    record.email_valid = true
+    record.data_public = true
+  end
+
+  unless user.confirmed?
+    user.activate!
+    user.confirm!

Why are we confirming the users? That's not a normal step - most users are only 
activated and confirmation is something that only happens occasionally if an 
admin wants to override an automatic suspension.

> +  puts(
+    <<~MESSAGE
+      #{initial_line}:
+        - Display name: #{display_name}
+        - Email: #{email}
+        - Password: #{password}
+    MESSAGE
+  )
+end
+
+namespace "dev" do
+  desc "Populate the development database with some fake data"
+  task "populate" => :environment do
+    raise "This task can only be run in development mode" unless 
Rails.env.development?
+
+    require "active_support/testing/time_helpers"

Does this need to be here or could it be at the top level? It was you that 
moved other requires out of nested scopes in 
3b5035461ffc83e20237239b32186dc0e4d97a9b after all ;-)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6432#pullrequestreview-3758731823
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/6432/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to