Skip to content

Instantly share code, notes, and snippets.

@sekrett
Created August 18, 2010 20:16
Show Gist options
  • Save sekrett/536032 to your computer and use it in GitHub Desktop.
Save sekrett/536032 to your computer and use it in GitHub Desktop.
#!/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