Class: HappySeed::Generators::DeviseConfirmableGenerator

Inherits:
HappySeedGenerator
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/happy_seed/devise_confirmable/devise_confirmable_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.fingerprintObject



10
11
12
# File 'lib/generators/happy_seed/devise_confirmable/devise_confirmable_generator.rb', line 10

def self.fingerprint
  # gem_available? 'devise_invitable'
end

Instance Method Details

#install_device_invitableObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/generators/happy_seed/devise_confirmable/devise_confirmable_generator.rb', line 14

def install_device_invitable
  # return if already_installed

  require_generator DeviseGenerator

  gsub_file "app/models/user.rb", "devise :", "devise :confirmable, :"

  migration_template("add_confirmable_to_devise.rb", "db/migrate/add_confirmable_to_devise.rb" )
  
  directory 'app'
  directory 'docs'
  directory 'spec'

  gsub_file 'config/routes.rb', "devise_for :users, :controllers => {", "devise_for :users, :controllers => { confirmations: 'confirmations', "
end