Class: Zencodable::Generators::Migration
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Zencodable::Generators::Migration
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/zencodable/migration_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/generators/zencodable/migration_generator.rb', line 16 def self.next_migration_number(dirname) if ActiveRecord::Base. migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i migration_number += 1 migration_number.to_s else "%.3d" % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#create_migration_files ⇒ Object
26 27 28 |
# File 'lib/generators/zencodable/migration_generator.rb', line 26 def create_migration_files migration_template 'zencodable_add_tracking_columns_and_tables.rb', "db/migrate/zencodable_add_tracking_columns_and_tables" end |