Class: Scoreable::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Scoreable::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/scoreable/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
9 10 11 |
# File 'lib/generators/scoreable/install_generator.rb', line 9 def self.next_migration_number(dirname) Time.now.strftime("%Y%m%d%H%M%S") end |
Instance Method Details
#copy_migration ⇒ Object
17 18 19 |
# File 'lib/generators/scoreable/install_generator.rb', line 17 def copy_migration migration_template "migration.rb", File.join("db", "migrate", "create_#{table_name}.rb") end |
#copy_model ⇒ Object
13 14 15 |
# File 'lib/generators/scoreable/install_generator.rb', line 13 def copy_model template "score_model.rb", File.join("app", "models", "#{Scoreable.score_term}.rb") end |
#show ⇒ Object
21 22 23 |
# File 'lib/generators/scoreable/install_generator.rb', line 21 def show readme "README2" end |
#table_name ⇒ Object
25 26 27 |
# File 'lib/generators/scoreable/install_generator.rb', line 25 def table_name Scoreable.table_name end |