Class: ReputationSystemGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/reputation_system/reputation_system_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



28
29
30
# File 'lib/generators/reputation_system/reputation_system_generator.rb', line 28

def self.next_migration_number(path)
  ActiveRecord::Generators::Base.next_migration_number(path)
end

Instance Method Details

#create_migration_filesObject



32
33
34
35
36
37
38
39
40
# File 'lib/generators/reputation_system/reputation_system_generator.rb', line 32

def create_migration_files
  create_migration_file_if_not_exist 'create_reputation_system'
  create_migration_file_if_not_exist 'add_reputations_index'
  create_migration_file_if_not_exist 'add_evaluations_index'
  create_migration_file_if_not_exist 'add_reputation_messages_index'
  create_migration_file_if_not_exist 'change_evaluations_index_to_unique'
  create_migration_file_if_not_exist 'change_reputation_messages_index_to_unique'
  create_migration_file_if_not_exist 'change_reputations_index_to_unique'
end