Class: IsTranslatable::MigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- IsTranslatable::MigrationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/is_translatable/migration_generator.rb
Class Method Summary collapse
-
.next_migration_number(dirname) ⇒ Object
Ugh :( Implement the required interface for Rails::Generators::Migration. taken from github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb.
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
Ugh :( Implement the required interface for Rails::Generators::Migration. taken from github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb
14 15 16 17 18 19 20 |
# File 'lib/generators/is_translatable/migration_generator.rb', line 14 def self.next_migration_number(dirname) if ActiveRecord::Base. Time.now.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#create_translatable_migration ⇒ Object
22 23 24 |
# File 'lib/generators/is_translatable/migration_generator.rb', line 22 def create_translatable_migration migration_template 'migration.rb', 'db/migrate/is_translatable_migration' end |