Class: Devise::Async::Stretch::InstallGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/devise/async/stretch/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_stretch_markObject



22
23
24
25
# File 'lib/generators/devise/async/stretch/install_generator.rb', line 22

def add_stretch_mark
  generate "migration", "AddStretchMarkTo#{name} stretch_mark:string"
  rake "db:migrate"
end

#copy_initializerObject



13
14
15
# File 'lib/generators/devise/async/stretch/install_generator.rb', line 13

def copy_initializer
  template "devise_async_stretch.rb", "config/initializers/devise_async_stretch.rb"
end

#inject_devise_invitable_contentObject



17
18
19
20
# File 'lib/generators/devise/async/stretch/install_generator.rb', line 17

def inject_devise_invitable_content
  path = File.join("app", "models", "#{file_path}.rb")
  inject_into_file(path, ", :stretchable", :after => ":database_authenticatable") if File.exists?(path)
end