Class: ActiveRecord::Generators::MlangMigrationGenerator
- Inherits:
-
Base
- Object
- Base
- ActiveRecord::Generators::MlangMigrationGenerator
- Defined in:
- lib/generators/active_record/mlang_migration_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.task_clear ⇒ Object
17 18 19 20 |
# File 'lib/generators/active_record/mlang_migration_generator.rb', line 17 def self.task_clear ActiveRecord::Base.connection.execute "DELETE FROM #{ActiveRecord::Mlang::Lang.table_name};" ActiveRecord::Base.connection.execute "DELETE FROM #{ActiveRecord::Mlang::LangText.table_name};" end |
.task_create ⇒ Object
11 12 13 14 15 |
# File 'lib/generators/active_record/mlang_migration_generator.rb', line 11 def self.task_create raise 'Task unavailable to this database (no migration support)' unless ActiveRecord::Base.connection.supports_migrations? Rails.application.load_generators if Rails.application ActiveRecord::Generators::MlangMigrationGenerator.start [ ENV['MIGRATION'] || 'create_langs_table' ] end |
Instance Method Details
#create_migration_file ⇒ Object
22 23 24 |
# File 'lib/generators/active_record/mlang_migration_generator.rb', line 22 def create_migration_file migration_template "migration.rb", "db/migrate/#{file_name}.rb" end |