Skip to content

Commit

Permalink
Hotfix for devise install script
Browse files Browse the repository at this point in the history
  • Loading branch information
justalever committed May 16, 2023
1 parent 3697baf commit 82e1849
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions lib/install/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,20 @@ def devise_installed?
end

def add_users
if devise_installed?
puts "Devise is already installed 🏄‍♂️"
else
# Install Devise
generate "devise:install"
# Install Devise
generate "devise:install"

# Configure Devise
environment "config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }",
env: 'development'
# Configure Devise
environment "config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }",
env: 'development'

# Create Devise User
generate :devise, "User", "first_name", "last_name", "admin:boolean"
# Create Devise User
generate :devise, "User", "first_name", "last_name", "admin:boolean"

# set admin boolean to false by default
in_root do
migration = Dir.glob("db/migrate/*").max_by{ |f| File.mtime(f) }
gsub_file migration, /:admin/, ":admin, default: false"
end
# set admin boolean to false by default
in_root do
migration = Dir.glob("db/migrate/*").max_by{ |f| File.mtime(f) }
gsub_file migration, /:admin/, ":admin, default: false"
end
end

Expand Down

0 comments on commit 82e1849

Please sign in to comment.