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