Class: SocialEngine::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/social_engine/install/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/generators/social_engine/install/install_generator.rb', line 9

def self.next_migration_number(dirname)
  sleep 1
  if ActiveRecord::Base.timestamped_migrations
    Time.now.utc.strftime("%Y%m%d%H%M%S")
  else
    "%.3d" % (current_migration_number(dirname) + 1)
  end
end

Instance Method Details

#create_migration_fileObject



18
19
20
21
22
23
24
25
26
# File 'lib/generators/social_engine/install/install_generator.rb', line 18

def create_migration_file
  migration_template 'create_comments_table.rb', 'db/migrate/create_comments_table.rb'
  migration_template 'create_votes_table.rb', 'db/migrate/create_votes_table.rb'
  migration_template 'create_ratings_table.rb', 'db/migrate/create_ratings_table.rb'
  migration_template 'create_favorites_table.rb', 'db/migrate/create_favorites_table.rb'
  migration_template 'create_reputations_table.rb', 'db/migrate/create_reputations_table.rb'
  migration_template 'create_reputation_actions_table.rb', 'db/migrate/create_reputation_actions_table.rb'    
  migration_template 'create_friendings_table.rb', 'db/migrate/create_friendings_table.rb'    
end

#create_static_assetsObject



28
29
30
31
32
# File 'lib/generators/social_engine/install/install_generator.rb', line 28

def create_static_assets
  copy_file "social_engine_yetting.yml", "config/yettings/social_engine.yml"
  copy_file "social_engine.css", "public/stylesheets/social_engine.css"    
  copy_file "formtastic.css", "public/stylesheets/formtastic.css"
end