Class: EasyML::Generators::Migration::MigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- EasyML::Generators::Migration::MigrationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/easy_ml/railtie/generators/migration/migration_generator.rb
Class Method Summary collapse
-
.next_migration_number(dirname) ⇒ Object
Specify the next migration number.
Instance Method Summary collapse
-
#create_migration_files ⇒ Object
Generate the migration files using the templates.
Class Method Details
.next_migration_number(dirname) ⇒ Object
Specify the next migration number
18 19 20 21 22 23 24 25 26 |
# File 'lib/easy_ml/railtie/generators/migration/migration_generator.rb', line 18 def self.next_migration_number(dirname) if ActiveRecord.version < Gem::Version.new("7") Time.now.utc.strftime("%Y%m%d%H%M%S") elsif ActiveRecord. Time.now.utc.strftime("%Y%m%d%H%M%S") else format("%.3d", (current_migration_number(dirname) + 1)) end end |
Instance Method Details
#create_migration_files ⇒ Object
Generate the migration files using the templates
29 30 31 |
# File 'lib/easy_ml/railtie/generators/migration/migration_generator.rb', line 29 def create_migration_files create_easy_ml_models_migration end |