Class: EnjuInventory::SetupGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/enju_inventory/setup/setup_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_setup_filesObject



4
5
6
7
8
9
10
11
12
# File 'lib/generators/enju_inventory/setup/setup_generator.rb', line 4

def copy_setup_files
  inject_into_file 'app/controllers/application_controller.rb',
    "  include EnjuInventory::Controller\n", after: "EnjuLibrary::Controller\n"
  append_to_file("app/models/user.rb") do
    <<"EOS"
Item.include(EnjuInventory::EnjuItem)
EOS
  end
end