Class: MentionSystemGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- MentionSystemGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/mention_system/mention_system_generator.rb
Overview
MentionSystemGenerator class
This class generates the mention model migration in mention system
Class Method Summary collapse
-
.next_migration_number(path) ⇒ String
Retrieves the next migration number.
-
.source_root ⇒ String
Retrieves the source root.
Instance Method Summary collapse
-
#generate_migration ⇒ Object
Generates the migration.
Class Method Details
.next_migration_number(path) ⇒ String
Retrieves the next migration number
35 36 37 |
# File 'lib/generators/mention_system/mention_system_generator.rb', line 35 def self.next_migration_number(path) ActiveRecord::Generators::Base.next_migration_number(path) end |
.source_root ⇒ String
Retrieves the source root
25 26 27 |
# File 'lib/generators/mention_system/mention_system_generator.rb', line 25 def self.source_root @source_root ||= File.dirname(__FILE__) + '/templates' end |
Instance Method Details
#generate_migration ⇒ Object
Generates the migration
42 43 44 |
# File 'lib/generators/mention_system/mention_system_generator.rb', line 42 def generate_migration migration_template 'migration.rb', 'db/migrate/create_mentions.rb' end |