class TreasureHunt::Generators::InstallGenerator

Public Class Methods

next_migration_number(path) click to toggle source
# File lib/generators/treasure_hunt/install/install_generator.rb, line 15
def self.next_migration_number(path)
  ActiveRecord::Generators::Base.next_migration_number(path)
end
source_root() click to toggle source
# File lib/generators/treasure_hunt/install/install_generator.rb, line 11
def self.source_root
  @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
end

Public Instance Methods

add_acts_as_treasure_hunter() click to toggle source
# File lib/generators/treasure_hunt/install/install_generator.rb, line 28
def add_acts_as_treasure_hunter
  say "Please add 'acts_as_treasure_hunter' to your User model", :green
end
generate_migration() click to toggle source
# File lib/generators/treasure_hunt/install/install_generator.rb, line 19
def generate_migration
  migration_template 'migration.rb', 'db/migrate/create_treasure_hunt_tables'
end
generate_models() click to toggle source
# File lib/generators/treasure_hunt/install/install_generator.rb, line 23
def generate_models
  template 'achievement.rb', 'app/models/achievement.rb'
  template 'reward.rb', 'app/models/reward.rb'
end