Class: Activist::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
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_numberObject



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_rootObject



9
10
11
# File 'lib/generators/activist/install/install_generator.rb', line 9

def self.source_root
  @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
end

Instance Method Details

#create_friendship_model_filesObject



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