Datenbankfrickeleien mit Ruby

Februar 12th, 2007

Aufgabenstellung: Import Expression Engine in Textpattern.

  • Alle überflüssigen Felder gelöscht
  • Rails-Projekt angelegt
  • Modelle gefüllt
  • Problem: Unix-Timestamp (entry_date) in Mysql (Posted):
ExpWeblogTitles.find(:all).each {|n| n.update_attribute(:Posted, Time.at(n[:entry_date]).to_s) }
  • Problem: AuthorID
ExpWeblogTitles.find(:all, :conditions => ["AuthorID = 4"]).each {|n| n.update_attribute(:AuthorID, "og") }
  • Problem: Body textilizieren:
e.each {|n| n.update_attribute(:Body_html, RedCloth.new(n.Body).to_html)}

*Problem: 2 Tabellen (EE) sind über entry_id verbunden, sollen in eine Tabelle. Verknüpft über Rails.

Sorry, comments are closed for this article.