Class: Easyhooks::MigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Easyhooks::MigrationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/easyhooks/migration/migration_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/generators/easyhooks/migration/migration_generator.rb', line 15 def self.next_migration_number(dirname) if Time.now.utc.strftime('%Y%m%d%H%M%S') else '%.3d' % (current_migration_number(dirname) + 1) end end |
.timestamped_migrations? ⇒ Boolean
23 24 25 26 |
# File 'lib/generators/easyhooks/migration/migration_generator.rb', line 23 def self. (ActiveRecord::Base.respond_to?(:timestamped_migrations) && ActiveRecord::Base.) || (ActiveRecord.respond_to?(:timestamped_migrations) && ActiveRecord.) end |
Instance Method Details
#create_migration_file ⇒ Object
11 12 13 |
# File 'lib/generators/easyhooks/migration/migration_generator.rb', line 11 def create_migration_file migration_template 'migration.rb','db/migrate/easyhooks_migration.rb' end |