Class: SpreeMobility::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_javascriptsObject



6
7
8
# File 'lib/generators/spree_mobility/install/install_generator.rb', line 6

def add_javascripts
     append_file "vendor/assets/javascripts/spree/backend/all.js", "//= require spree/backend/spree_mobility\n"
end

#add_migrationsObject



10
11
12
# File 'lib/generators/spree_mobility/install/install_generator.rb', line 10

def add_migrations
  run 'bundle exec rake spree_mobility:install:migrations'
end

#run_migrationsObject



14
15
16
17
18
19
20
# File 'lib/generators/spree_mobility/install/install_generator.rb', line 14

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