Class: Spree::Auth::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/spree/auth/install/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_pathsObject



7
8
9
10
11
# File 'lib/generators/spree/auth/install/install_generator.rb', line 7

def self.source_paths
  paths = superclass.source_paths
  paths << File.expand_path('../templates', __FILE__)
  paths.flatten
end

Instance Method Details

#add_migrationsObject



18
19
20
# File 'lib/generators/spree/auth/install/install_generator.rb', line 18

def add_migrations
  run 'bundle exec rake railties:install:migrations FROM=spree_auth'
end

#generate_devise_keyObject



13
14
15
16
# File 'lib/generators/spree/auth/install/install_generator.rb', line 13

def generate_devise_key
  return if ENV['CI']
  template 'config/initializers/devise.rb', 'config/initializers/devise.rb'
end

#run_migrationsObject



22
23
24
25
26
27
28
# File 'lib/generators/spree/auth/install/install_generator.rb', line 22

def run_migrations
 if options[:migrate]
   run 'bundle exec rake db:migrate VERBOSE=false'
 else
   puts "Skiping rake db:migrate, don't forget to run it!"
 end
end