August 24, 2005

One-liner with Rails and ActiveRecord

Matthew Bohnsack breaks down this one-liner:

Article.find_all.each { |a| a.body.gsub!(/src="\/(.*.(jpg|gif|png))/, 'src=\"http://bohnsack.com\1'); a.save }

Posted by Josh at August 24, 2005 12:30 AM
Comments
Post a comment