In Files

Parent

Methods

Class Index [+]

Quicksearch

WPB::App

Public Class Methods

run() click to toggle source
    # File lib/wpb.rb, line 30
30:                 def self.run
31:                config = {
32:                                 :adapter  => "mysql",
33:                                 :socket   => "/Applications/MAMP/tmp/mysql/mysql.sock", #/tmp/mysql.sock
34:                                 :host     => "localhost",
35:                                 :username => "root",
36:                                 :password => "root",
37:                                 :database => "wordpress"
38:                         }
39: 
40:                         ActiveRecord::Base.establish_connection(config)
41: 
42:                         AddType::up
43:                         PagePost.all.each do |p|
44:                                 p.type = p.post_type.capitalize
45:                                 if p.post_type != "post" && p.post_type != "page"
46:                                         p.type = "Post"
47:                                 end
48:                                 p.save
49:                         end
50:           end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.