<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mindtonic &#187; Paperclip</title>
	<atom:link href="http://blog.mindtonic.net/tag/paperclip/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mindtonic.net</link>
	<description>Thoughts on Music and Application Development</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:08:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Converting attachment_fu to Paperclip</title>
		<link>http://blog.mindtonic.net/converting-attachment_fu-to-paperclip/</link>
		<comments>http://blog.mindtonic.net/converting-attachment_fu-to-paperclip/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 15:37:56 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Gems]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[Paperclip]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=118</guid>
		<description><![CDATA[I am making the transition from attachment_fu to paperclip on a very large project of mine. I wrote the following method, inside of my old attachment_fu model ItemImage to do the work. I wrote it to run from inside the rails console. It gives handy messages out letting you know what happened. Reference: http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip def [...]]]></description>
			<content:encoded><![CDATA[<p>I am making the transition from attachment_fu to <a href="http://github.com/thoughtbot/paperclip">paperclip</a> on a very large project of mine.  I wrote the following method, inside of my old attachment_fu model ItemImage to do the work.  I wrote it to run from inside the rails console.  It gives handy messages out letting you know what happened.</p>
<p>Reference: <a href="http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip">http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip</a></p>
<textarea cols="40" rows="10" name="code" class="Ruby">def self.convert_fu
  for item in Item.all
    # has an image
    if item.item_image
      # the image exists
      filename = "public" + item.item_image.public_filename
      if File::exists?(filename)
        image = File.open(filename)
        item.image = image
        item.save
        puts "#{item.name} Image Converted"
      else
        puts "====&gt; #{item.name} Image could not be found"
      end
    else
      puts "#{item.name} has no image"
    end
  end
end</textarea>
	<!-- WordPress Code Snippet -->
	<script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shBrushRuby.js"></script>
	<link type="text/css" rel="stylesheet" href="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End WordPress Code Snippet -->
	]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/converting-attachment_fu-to-paperclip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
