Sha256: ced8c61a5dbeaa34ef2b3318d6ca18ed0e43b22fdc61e35f8d0852bdd9974373

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

# Application template recipe for the rails_apps_composer. Change the recipe here:
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/devise.rb

stage_two do
  say_wizard "recipe stage two"
  if prefer :authentication, 'devise'
    # prevent logging of password_confirmation
    gsub_file 'config/initializers/filter_parameter_logging.rb', /:password/, ':password, :password_confirmation'
    generate 'devise:install'
    generate 'devise_invitable:install' if prefer :devise_modules, 'invitable'
    generate 'devise user' # create the User model
    unless :apps4.to_s.include? 'rails-stripe-'
      generate 'migration AddNameToUsers name:string'
    end
    if (prefer :devise_modules, 'confirmable') || (prefer :devise_modules, 'invitable')
      gsub_file 'app/models/user.rb', /:registerable,/, ":registerable, :confirmable,"
      generate 'migration AddConfirmableToUsers confirmation_token:string confirmed_at:datetime confirmation_sent_at:datetime unconfirmed_email:string'
    end
    run 'bundle exec rake db:migrate'
  end
  ### GIT ###
  git :add => '-A' if prefer :git, true
  git :commit => '-qm "redmint_composer: devise"' if prefer :git, true
end

__END__

name: devise
description: "Add Devise for authentication"
author: RailsApps

requires: [setup, gems]
run_after: [setup, gems]
category: mvc

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redmint_composer-2.3 recipes/devise.rb