Class: HappySeed::Generators::DeviseInvitableGenerator

Inherits:
HappySeedGenerator
  • Object
show all
Defined in:
lib/generators/happy_seed/devise_invitable/devise_invitable_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.fingerprintObject



8
9
10
# File 'lib/generators/happy_seed/devise_invitable/devise_invitable_generator.rb', line 8

def self.fingerprint
  gem_available? 'devise_invitable'
end

Instance Method Details

#install_device_invitableObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/generators/happy_seed/devise_invitable/devise_invitable_generator.rb', line 12

def install_device_invitable
  return if already_installed

  require_generator DeviseGenerator

  gem 'devise_invitable', github: "scambra/devise_invitable"

  Bundler.with_clean_env do
    run "bundle install --without production"
    run 'rake db:migrate'
  end

  run 'rails generate devise_invitable:install'
  run 'rails generate devise_invitable User'
  run 'rails generate devise_invitable:views'

  remove_file 'app/views/devise/mailer/invitation_instructions.html.erb'
  
  directory '.'

  if gem_available?( "haml-rails" )
    remove_file 'app/views/devise/invitations/new.html.erb'
    remove_file 'app/views/devise/invitations/edit.html.erb'
  end
end