Created
August 18, 2010 20:16
-
-
Save sekrett/536032 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'yaml' | |
require 'active_record' | |
require 'sanitize' | |
ActiveRecord::Base.establish_connection(YAML::load(File.open("./database.yml"))['production']) | |
class Manufacturer < ActiveRecord::Base | |
set_table_name 'konzept_manufacturers' | |
set_primary_key 'id_manufacturer' | |
end | |
Manufacturer.all.each do |m| | |
# m.content = Sanitize.clean(m.content, :elements => ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']) | |
m.content = Sanitize.clean(m.content, Sanitize::Config::RELAXED) | |
m.save! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment