Class: E9Crm::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/e9_crm/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object

:nodoc:



11
12
13
14
15
16
17
# File 'lib/generators/e9_crm/install_generator.rb', line 11

def self.next_migration_number(dirname) #:nodoc:
  if ActiveRecord::Base.timestamped_migrations
    Time.now.utc.strftime("%Y%m%d%H%M%S")
  else
    "%.3d" % (current_migration_number(dirname) + 1)
  end
end

Instance Method Details

#copy_initializerObject



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

def copy_initializer
  copy_file 'initializer.rb', 'config/initializers/e9_crm.rb'
end

#copy_javascriptObject



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

def copy_javascript
  copy_file 'javascript.js', 'public/javascripts/e9_crm.js'
end

#generate_migrationsObject



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

def generate_migrations
  migration_template 'migration.rb', 'db/migrate/create_e9_crm_structure.rb'
end