Class: RatingFor::MigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- RatingFor::MigrationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/rating_for/migration/migration_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/generators/rating_for/migration/migration_generator.rb', line 14 def self.next_migration_number(path) if ActiveRecord::Base. Time.now.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(path) + 1) end end |
.source_root ⇒ Object
10 11 12 |
# File 'lib/generators/rating_for/migration/migration_generator.rb', line 10 def self.source_root @source_root ||= File.('../templates', __FILE__) end |
Instance Method Details
#manifest ⇒ Object
22 23 24 |
# File 'lib/generators/rating_for/migration/migration_generator.rb', line 22 def manifest migration_template 'migration.rb', 'db/migrate/create_rating_for_tables' end |