<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Randomize Filename in Paperclip</title>
	<atom:link href="http://trevorturk.wordpress.com/2009/03/22/randomize-filename-in-paperclip/feed/" rel="self" type="application/rss+xml" />
	<link>http://trevorturk.wordpress.com/2009/03/22/randomize-filename-in-paperclip/</link>
	<description>A chess-playing machine of the late 18th century, promoted as an automaton but later proved a hoax.</description>
	<lastBuildDate>Mon, 30 Jan 2012 07:56:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: paxer</title>
		<link>http://trevorturk.wordpress.com/2009/03/22/randomize-filename-in-paperclip/#comment-849</link>
		<dc:creator><![CDATA[paxer]]></dc:creator>
		<pubDate>Wed, 01 Jun 2011 21:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1247#comment-849</guid>
		<description><![CDATA[the problem of this method is if you have a validation in your model, then it fail ... 
to fix this i use  before_post_process :randomize_file_name instead of before_create :randomize_file_name ]]></description>
		<content:encoded><![CDATA[<p>the problem of this method is if you have a validation in your model, then it fail &#8230;<br />
to fix this i use  before_post_process :randomize_file_name instead of before_create :randomize_file_name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paperclip: timestamping attachments on upload</title>
		<link>http://trevorturk.wordpress.com/2009/03/22/randomize-filename-in-paperclip/#comment-848</link>
		<dc:creator><![CDATA[Paperclip: timestamping attachments on upload]]></dc:creator>
		<pubDate>Tue, 22 Mar 2011 15:39:47 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1247#comment-848</guid>
		<description><![CDATA[[...] key bit is using the attachment&#8217;s #instance_write method, as suggested by Trevor Turk for a slightly different [...] ]]></description>
		<content:encoded><![CDATA[<p>[...] key bit is using the attachment&#8217;s #instance_write method, as suggested by Trevor Turk for a slightly different [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kerberos</title>
		<link>http://trevorturk.wordpress.com/2009/03/22/randomize-filename-in-paperclip/#comment-847</link>
		<dc:creator><![CDATA[kerberos]]></dc:creator>
		<pubDate>Fri, 11 Feb 2011 14:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1247#comment-847</guid>
		<description><![CDATA[Thanks, the second example works like a charm. ]]></description>
		<content:encoded><![CDATA[<p>Thanks, the second example works like a charm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergiy</title>
		<link>http://trevorturk.wordpress.com/2009/03/22/randomize-filename-in-paperclip/#comment-846</link>
		<dc:creator><![CDATA[Sergiy]]></dc:creator>
		<pubDate>Tue, 15 Sep 2009 08:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1247#comment-846</guid>
		<description><![CDATA[I patched your code and found this more useful in my project:
 

 
  def randomize_file_name
 
    return if image_file_name.nil?
 
    extension = File.extname(image_file_name).downcase
 
    if image_file_name_changed?
 
      self.image.instance_write(:file_name, &quot;#{ActiveSupport::SecureRandom.hex(16)}#{extension}&quot;)
 
    end
 
  end ]]></description>
		<content:encoded><![CDATA[<p>I patched your code and found this more useful in my project:</p>
<p>  def randomize_file_name</p>
<p>    return if image_file_name.nil?</p>
<p>    extension = File.extname(image_file_name).downcase</p>
<p>    if image_file_name_changed?</p>
<p>      self.image.instance_write(:file_name, &quot;#{ActiveSupport::SecureRandom.hex(16)}#{extension}&quot;)</p>
<p>    end</p>
<p>  end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zoran</title>
		<link>http://trevorturk.wordpress.com/2009/03/22/randomize-filename-in-paperclip/#comment-845</link>
		<dc:creator><![CDATA[Zoran]]></dc:creator>
		<pubDate>Sun, 05 Apr 2009 15:30:44 +0000</pubDate>
		<guid isPermaLink="false">http://almosteffortless.com/?p=1247#comment-845</guid>
		<description><![CDATA[Thanks for sharing! This is indeed useful. ]]></description>
		<content:encoded><![CDATA[<p>Thanks for sharing! This is indeed useful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

