Class: Activist::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Activist::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/activist/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number ⇒ Object
13 14 15 |
# File 'lib/generators/activist/install/install_generator.rb', line 13 def self.next_migration_number Time.now.utc.strftime('%Y%m%d%H%M%S') end |
.source_root ⇒ Object
9 10 11 |
# File 'lib/generators/activist/install/install_generator.rb', line 9 def self.source_root @source_root ||= File.(File.join(File.dirname(__FILE__), 'templates')) end |
Instance Method Details
#create_friendship_model_files ⇒ Object
18 19 20 21 |
# File 'lib/generators/activist/install/install_generator.rb', line 18 def create_friendship_model_files template 'activist_status.rb', 'app/models/activist_status.rb' template 'create_activist_statuses.rb', "db/migrate/#{self.class.next_migration_number}_create_activist_statuses.rb" end |