diff --git a/db/seeds/001_users.rb b/db/seeds/001_users.rb index 264e5eb05..4c2011d44 100644 --- a/db/seeds/001_users.rb +++ b/db/seeds/001_users.rb @@ -1,10 +1,18 @@ # frozen_string_literal: true -User.find_or_create_by!( - email: 'admin@lvh.me' -) do |user| - user.password = 'password' - user.password_confirmation = 'password' -end.update!( - role: :root -) +module UserSeeder + module_function + + def run + user = User.find_or_create_by!(email: 'admin@lvh.me') do |u| + u.password = 'password' + u.password_confirmation = 'password' + u.role = :root + end + + user.invite! + user.accept_invitation! + end +end + +UserSeeder.run