Class: LockerGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- LockerGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/locker/locker_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
7 8 9 |
# File 'lib/generators/locker/locker_generator.rb', line 7 def self.next_migration_number(path) Time.now.utc.strftime("%Y%m%d%H%M%S") end |
Instance Method Details
#create_locker_files ⇒ Object
11 12 13 14 |
# File 'lib/generators/locker/locker_generator.rb', line 11 def create_locker_files migration_template "migration.rb", "db/migrate/create_#{plural_name}.rb" template "model.rb", "app/models/#{singular_name}.rb" end |