Class: Notable::Generators::JobsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Notable::Generators::JobsGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/notable/jobs_generator.rb
Class Method Summary collapse
-
.next_migration_number(dirname) ⇒ Object
Implement the required interface for Rails::Generators::Migration.
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
Implement the required interface for Rails::Generators::Migration.
15 16 17 18 19 20 21 22 |
# File 'lib/generators/notable/jobs_generator.rb', line 15 def self.next_migration_number(dirname) #:nodoc: next_migration_number = current_migration_number(dirname) + 1 if ActiveRecord::Base. [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max else "%.3d" % next_migration_number end end |
Instance Method Details
#copy_migration ⇒ Object
24 25 26 |
# File 'lib/generators/notable/jobs_generator.rb', line 24 def copy_migration migration_template "create_jobs.rb", "db/migrate/create_notable_jobs.rb" end |