Class: Saucy::Generators::InstallGenerator

Inherits:
Base
  • Object
show all
Extended by:
ActiveRecord::Generators::Migration
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/saucy/install/install_generator.rb

Instance Method Summary collapse

Methods inherited from Base

source_root

Instance Method Details

#add_account_authorizationObject



37
38
39
40
41
# File 'lib/generators/saucy/install/install_generator.rb', line 37

def 
  insert_into_file "app/controllers/application_controller.rb",
                   "\ninclude Saucy::AccountAuthorization",
                   :after => "include Clearance::Authentication"
end

#create_controllersObject



27
28
29
# File 'lib/generators/saucy/install/install_generator.rb', line 27

def create_controllers
  directory "controllers", "app/controllers"
end

#create_modelsObject



23
24
25
# File 'lib/generators/saucy/install/install_generator.rb', line 23

def create_models
  directory "models", "app/models"
end

#generate_migrationObject



15
16
17
# File 'lib/generators/saucy/install/install_generator.rb', line 15

def generate_migration
  migration_template "create_saucy_tables.rb", "db/migrate/create_saucy_tables.rb"
end

#rake_engine_migrationsObject



19
20
21
# File 'lib/generators/saucy/install/install_generator.rb', line 19

def rake_engine_migrations
  rake("saucy_engine:install:migrations")
end

#update_user_modelObject



31
32
33
34
35
# File 'lib/generators/saucy/install/install_generator.rb', line 31

def update_user_model
  insert_into_file "app/models/user.rb",
                   "\ninclude Saucy::User",
                   :after => "include Clearance::User"
end