<?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>info.michael-simons.eu &#187; Rails</title>
	<atom:link href="http://info.michael-simons.eu/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://info.michael-simons.eu</link>
	<description>Just another nerd blog</description>
	<lastBuildDate>Wed, 08 Feb 2012 10:26:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Preparing for Rails 2.3.9</title>
		<link>http://info.michael-simons.eu/2010/09/06/preparing-for-rails-2-3-9/</link>
		<comments>http://info.michael-simons.eu/2010/09/06/preparing-for-rails-2-3-9/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 12:12:29 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=432</guid>
		<description><![CDATA[As much as i wish to upgrade my Rails 2.3.x application Daily Fratze to the newest tag of the Rails 2.3.x branch, i cannot. First there was the epic fail of release 2.3.6, that broke all HTML Helpers and forced the Rails XSS protection upon us. This release was immediately followed by 2.3.7 and 2.3.8. [...]]]></description>
			<content:encoded><![CDATA[<p>As much as i wish to upgrade my Rails 2.3.x application <a href="http://dailyfratze.de">Daily Fratze</a> to the newest tag of the Rails 2.3.x branch, i cannot.</p>
<p>First there was the epic fail of release 2.3.6, that broke all HTML Helpers and forced the Rails XSS protection upon us. This release was immediately followed by 2.3.7 and 2.3.8. With my tests, this version was still enforcing Rails XSS and breaking helpers like &#8220;h&#8221;.</p>
<p>Rails 2.3.9, released last week, puts en end to this.</p>
<p>I just was about to upgrade, when i read this error: <a href="https://rails.lighthouseapp.com/projects/8994/tickets/4808-textarea-input-silently-truncated-in-238">Textarea input silently truncated in 2.3.8!</a>. The input of a textarea is truncated if the text entered consists of two lines or more with one of them quoted as the Rack middleware messes with the input. </p>
<p>I can confirm that this behavior still applies to 2.3.9.</p>
<p>It&#8217;s a shame, that all the talk is about Rails 3 with bugs like this in an older branch. I understand that this is a Rack problem but as it is already fixed in newer Rack versions, i cannot understand that the Rails team doesn&#8217;t bump the required Rack version respectively has no tests for problems like these.</p>
<p>So i&#8217;m hoping that Rails 2.3.10 sees the light of day anytime soon.</p>
<p>Anyway, as Rails 2.3.9 suddenly uses a new interpolation syntax for the translation files (&#8220;Hello {{name}}&#8221; becomes &#8221; Hello %{name}&#8221;), here is a one-liner to update i18n files to the new syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-iname</span> <span style="color: #ff0000;">&quot;*.yml&quot;</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/{{\([^\{\}]*\)}}/%{\1}/g'</span> <span style="color: #660033;">-i</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;</pre></div></div>

<p>If you like some less escapism use xargs</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-iname</span> <span style="color: #ff0000;">&quot;*.yml&quot;</span>  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/{{\([^{}]*\)}}/%{\1}/g'</span> <span style="color: #660033;">-i</span>;</pre></div></div>

<p>Commands need to be executed inside your locale directory.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=432&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_432" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2010/09/06/preparing-for-rails-2-3-9/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to change the image assets path in Rails</title>
		<link>http://info.michael-simons.eu/2009/11/01/how-to-change-the-image-assets-path-in-rails/</link>
		<comments>http://info.michael-simons.eu/2009/11/01/how-to-change-the-image-assets-path-in-rails/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 08:16:33 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=372</guid>
		<description><![CDATA[I found no other way to change the path of &#8220;images&#8221; in a Rails application than monkey patching the AssetTagHelper like so: module ActionView module Helpers #:nodoc: module AssetTagHelper def image_path&#40;source&#41; compute_public_path&#40;source, 'static_images'&#41; end alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route end end end Share This]]></description>
			<content:encoded><![CDATA[<p>I found no other way to change the path of &#8220;images&#8221; in a Rails application than monkey patching the AssetTagHelper like so:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> ActionView
  <span style="color:#9966CC; font-weight:bold;">module</span> Helpers <span style="color:#008000; font-style:italic;">#:nodoc:</span>
    <span style="color:#9966CC; font-weight:bold;">module</span> AssetTagHelper
      <span style="color:#9966CC; font-weight:bold;">def</span> image_path<span style="color:#006600; font-weight:bold;">&#40;</span>source<span style="color:#006600; font-weight:bold;">&#41;</span>
        compute_public_path<span style="color:#006600; font-weight:bold;">&#40;</span>source, <span style="color:#996600;">'static_images'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      alias_method <span style="color:#ff3333; font-weight:bold;">:path_to_image</span>, <span style="color:#ff3333; font-weight:bold;">:image_path</span> <span style="color:#008000; font-style:italic;"># aliased to avoid conflicts with an image_path named route</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p class="akst_link"><a href="http://info.michael-simons.eu/?p=372&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_372" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/11/01/how-to-change-the-image-assets-path-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redcloth / Textilize :hard_breaks is broken in Rails 2.3.4</title>
		<link>http://info.michael-simons.eu/2009/09/24/redcloth-textilize-hard_breaks-is-broken-in-rails-2-3-4/</link>
		<comments>http://info.michael-simons.eu/2009/09/24/redcloth-textilize-hard_breaks-is-broken-in-rails-2-3-4/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 18:59:46 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=368</guid>
		<description><![CDATA[The default behavior for quite a long time was :hard_breaks in the textilize helper method in rails. Hard Breaks means: All line breaks are turned into &#60;br /&#62;&#8217;s. Somebody changed the textilize helper in &#8220;actionpack-2.3.4/lib/action_view/helpers/text_helper.rb&#8221; in 2.3.4 and added the ability to pass some options but broke the default behavior here: def textilize&#40;text, *options&#41; options [...]]]></description>
			<content:encoded><![CDATA[<p>The default behavior for quite a long time was :hard_breaks in the textilize helper method in rails. </p>
<p>Hard Breaks means: All line breaks are turned into &lt;br /&gt;&#8217;s. </p>
<p>Somebody changed the textilize helper in &#8220;actionpack-2.3.4/lib/action_view/helpers/text_helper.rb&#8221; in 2.3.4 and added the ability to pass some options but broke the default behavior here:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> textilize<span style="color:#006600; font-weight:bold;">&#40;</span>text, <span style="color:#006600; font-weight:bold;">*</span>options<span style="color:#006600; font-weight:bold;">&#41;</span>
        options <span style="color:#006600; font-weight:bold;">||</span>= <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:hard_breaks</span><span style="color:#006600; font-weight:bold;">&#93;</span>
        <span style="color:#008000; font-style:italic;"># ...</span></pre></div></div>

<p>Options will never be null.</p>
<p>I fixed this by monkey patching the module through the following code in config/initializers/textilizepatch.rb</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> ActionView
  <span style="color:#9966CC; font-weight:bold;">module</span> Helpers
    <span style="color:#9966CC; font-weight:bold;">module</span> TextHelper
      <span style="color:#9966CC; font-weight:bold;">def</span> textilize<span style="color:#006600; font-weight:bold;">&#40;</span>text, <span style="color:#006600; font-weight:bold;">*</span>options<span style="color:#006600; font-weight:bold;">&#41;</span>
        options = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:hard_breaks</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options == <span style="color:#0000FF; font-weight:bold;">nil</span> <span style="color:#006600; font-weight:bold;">||</span> options.<span style="color:#9900CC;">size</span> == <span style="color:#006666;">0</span>
&nbsp;
        <span style="color:#9966CC; font-weight:bold;">if</span> text.<span style="color:#9900CC;">blank</span>?
          <span style="color:#996600;">&quot;&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">else</span>
          textilized = RedCloth.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>text, options<span style="color:#006600; font-weight:bold;">&#41;</span>
          textilized.<span style="color:#9900CC;">to_html</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Such changes should be tested… *grml*</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=368&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_368" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/09/24/redcloth-textilize-hard_breaks-is-broken-in-rails-2-3-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logging in Rails outside a controller</title>
		<link>http://info.michael-simons.eu/2009/08/25/logging-in-rails-outside-a-controller/</link>
		<comments>http://info.michael-simons.eu/2009/08/25/logging-in-rails-outside-a-controller/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 05:25:43 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Code Snippets]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2009/08/25/logging-in-rails-outside-a-controller/</guid>
		<description><![CDATA[You can use RAILS_DEFAULT_LOGGER.log &#34;foobar&#34; # or Rails.logger.log &#34;blah&#34; outside a controller for logging. Share This]]></description>
			<content:encoded><![CDATA[<p>You can use</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">RAILS_DEFAULT_LOGGER.<span style="color:#9900CC;">log</span> <span style="color:#996600;">&quot;foobar&quot;</span>
<span style="color:#008000; font-style:italic;"># or</span>
Rails.<span style="color:#9900CC;">logger</span>.<span style="color:#9900CC;">log</span> <span style="color:#996600;">&quot;blah&quot;</span></pre></div></div>

<p>outside a controller for logging.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=364&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_364" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/08/25/logging-in-rails-outside-a-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phusion Passenger and memcache-client revisited</title>
		<link>http://info.michael-simons.eu/2009/03/23/phusion-passenger-and-memcache-client-revisited/</link>
		<comments>http://info.michael-simons.eu/2009/03/23/phusion-passenger-and-memcache-client-revisited/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 10:35:49 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=313</guid>
		<description><![CDATA[The last Passenger update brought some good explanation off the problems regarding Passenger and memcache-client (see here). Smart spawning of Passenger processes creates shared file descriptors. As the connections to memcached are sockets they are shared as well so data on them gets corrupted which is explained very nicely in the Passenger documentation: Example 1: [...]]]></description>
			<content:encoded><![CDATA[<p>The last <a href="http://www.modrails.com/">Passenger</a> update brought some good explanation off the problems regarding Passenger and memcache-client (see <a href="http://info.michael-simons.eu/2009/02/23/phusion-passenger-and-memcached-memcache-client/">here</a>). </p>
<p>Smart spawning of Passenger processes creates shared file descriptors. As the connections to memcached are sockets they are shared as well so data on them gets corrupted which is explained very nicely in the Passenger documentation: <a href="http://www.modrails.com/documentation/Users%20guide.html#_example_1_memcached_connection_sharing_harmful">Example 1: Memcached connection sharing (harmful)</a>.</p>
<p>The solution presented there works like a charm. The <em>reestablish_connection_to_memcached</em> line is actually not more than <em>CACHE.reset</em> where CACHE is the reference to the memcache connection.</p>
<p>After that change, spawning methods smart-lv2 and smart will work in connection with environment.rb configured memcache connections.</p>
<p><ins datetime="2009-03-25T15:15:15+00:00">Edit</ins>: As requested in the comments, a little example:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">memcache_options = <span style="color:#006600; font-weight:bold;">&#123;</span>
  <span style="color:#ff3333; font-weight:bold;">:c_threshold</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">10000</span>,
  <span style="color:#ff3333; font-weight:bold;">:compression</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>,
  <span style="color:#ff3333; font-weight:bold;">:debug</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>,
  <span style="color:#ff3333; font-weight:bold;">:namespace</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'some_ns'</span>,
  <span style="color:#ff3333; font-weight:bold;">:readonly</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>,
  <span style="color:#ff3333; font-weight:bold;">:urlencode</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
CACHE = MemCache.<span style="color:#9900CC;">new</span> memcache_options
CACHE.<span style="color:#9900CC;">servers</span> = <span style="color:#996600;">'127.0.0.1:11211'</span>
<span style="color:#9966CC; font-weight:bold;">begin</span>
   PhusionPassenger.<span style="color:#9900CC;">on_event</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:starting_worker_process</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>forked<span style="color:#006600; font-weight:bold;">|</span>
     <span style="color:#9966CC; font-weight:bold;">if</span> forked
       <span style="color:#008000; font-style:italic;"># We're in smart spawning mode, so...</span>
       <span style="color:#008000; font-style:italic;"># Close duplicated memcached connections - they will open themselves</span>
       CACHE.<span style="color:#9900CC;">reset</span>
     <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#008000; font-style:italic;"># In case you're not running under Passenger (i.e. devmode with mongrel)</span>
<span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">NameError</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> error
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>In this case, CACHE is the global constant that i use to access my memcache-client.</p>
<p>I guess you&#8217;ll need to do the same with the global Rails.cache object, but i&#8217;m not sure. Anyway, the above solution works for me. </p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=313&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_313" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/03/23/phusion-passenger-and-memcache-client-revisited/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Phusion Passenger and memcached / memcache-client</title>
		<link>http://info.michael-simons.eu/2009/02/23/phusion-passenger-and-memcached-memcache-client/</link>
		<comments>http://info.michael-simons.eu/2009/02/23/phusion-passenger-and-memcached-memcache-client/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 16:23:46 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=294</guid>
		<description><![CDATA[I recently switch from a mod_proxy / thin setup to Phusion Passenger and my application started to do the funniest things and the production.log was full with errors related to memcached. It seems, that passengers spawn method &#8220;smart&#8221; isn&#8217;t compatible with memcached. Within seconds on a lightly loaded server the cache gets corrupted big time. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switch from a mod_proxy / thin setup to <a href="http://www.modrails.com/">Phusion Passenger</a> and my application started to do the funniest things and the production.log was full with errors related to memcached.</p>
<p>It seems, that passengers spawn method &#8220;smart&#8221; isn&#8217;t compatible with memcached. Within seconds on a lightly loaded server the cache gets corrupted big time.</p>
<p>I got better results with a newer memcache client (the ruby gem actually), but for that i need to remove the client from the rails vendor lib. Furthermore, under higher load there still where errors.</p>
<p>Only solution is to set the spawn method to conservative like so</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">RailsSpawnMethod conservative</pre></div></div>

<p>Problem seems to be known in the Phusion and Rails teams.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=294&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_294" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/02/23/phusion-passenger-and-memcached-memcache-client/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Localizing dates and time with Rails&#8217; I18n using procs</title>
		<link>http://info.michael-simons.eu/2009/02/12/localizing-dates-and-time-with-rails-i18n-using-procs/</link>
		<comments>http://info.michael-simons.eu/2009/02/12/localizing-dates-and-time-with-rails-i18n-using-procs/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 14:19:29 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Code Snippets]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=288</guid>
		<description><![CDATA[Ruby on Rails I18n infrastructure did a great job to internationalization in Rails applications. Most things work right out of the box. Daily Fratze is fully internationalized and i wanted to use ordinal day numbers in the English version. Pity, there is no template for strftime that works that way. As i already hat monkey [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rubyonrails.org/">Ruby on Rails</a> I18n infrastructure did a great job to internationalization in Rails applications. Most things work right out of the box.</p>
<p><a href="http://dailyfratze.de">Daily Fratze</a> is fully internationalized and i wanted to use ordinal day numbers in the English version. Pity, there is no template for strftime that works that way.</p>
<p>As i already hat monkey patched a &#8220;t&#8221; method to all date and time related classes, i came up with the following solution:</p>
<p>Parallel to &#8220;en.yml&#8221; i now have &#8220;en.rb&#8221; in my locales folder which gets loaded in environment.rb via</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">config.<span style="color:#9900CC;">i18n</span>.<span style="color:#9900CC;">load_path</span> <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#CC00FF; font-weight:bold;">Dir</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>RAILS_ROOT, <span style="color:#996600;">'app'</span>, <span style="color:#996600;">'locales'</span>, <span style="color:#996600;">'*.{yml,rb}'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span></pre></div></div>

<p>The en.rb files defines some procs as translation values like so:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&#123;</span>
  :<span style="color:#996600;">'en'</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
    <span style="color:#ff3333; font-weight:bold;">:date</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:formats</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
        <span style="color:#ff3333; font-weight:bold;">:dmy_with_long_month</span>              <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>date<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#996600;">&quot;%B #{date.day.ordinalize}, %Y&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>,
      <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>,
    <span style="color:#ff3333; font-weight:bold;">:time</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#ff3333; font-weight:bold;">:formats</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
        <span style="color:#ff3333; font-weight:bold;">:dmy_with_long_month</span>                       <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>date<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#996600;">&quot;%B #{date.day.ordinalize}, %Y&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>,        
        <span style="color:#ff3333; font-weight:bold;">:dmy_with_full_day_and_long_month_and_time</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>date<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#996600;">&quot;%A, %B #{date.day.ordinalize}, %Y at %H:%M&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Used with the standard I18n tools you&#8217;ll end up with the string representation of the proc object. Useless <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So time for monkeypatching like so:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> DateTimeSupport
  <span style="color:#9966CC; font-weight:bold;">def</span> t<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">format</span> = <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    type = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">respond_to</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:sec</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#996600;">'time'</span> : <span style="color:#996600;">'date'</span>
    formats = I18n.<span style="color:#9900CC;">translate</span><span style="color:#006600; font-weight:bold;">&#40;</span>:<span style="color:#996600;">&quot;#{type}.formats&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#CC0066; font-weight:bold;">format</span> = formats<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">to_sym</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">if</span> formats <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> formats<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">to_sym</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
    I18n.<span style="color:#9900CC;">localize</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span>, :<span style="color:#CC0066; font-weight:bold;">format</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">respond_to</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:call</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#CC0066; font-weight:bold;">format</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC00FF; font-weight:bold;">Time</span>
  <span style="color:#9966CC; font-weight:bold;">include</span> DateTimeSupport
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC00FF; font-weight:bold;">Date</span>
  <span style="color:#9966CC; font-weight:bold;">include</span> DateTimeSupport
<span style="color:#9966CC; font-weight:bold;">end</span>       
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC00FF; font-weight:bold;">DateTime</span>
  <span style="color:#9966CC; font-weight:bold;">include</span> DateTimeSupport
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#6666ff; font-weight:bold;">ActiveSupport::TimeWithZone</span>
  <span style="color:#9966CC; font-weight:bold;">include</span> DateTimeSupport
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Code resides in a file in config/initializers and gets loaded automatically. It adds a t method to all date and time related classes. The method tries to look up the translation of format just like I18n/Simple does.</p>
<p>If it is proc, it gets called and then passed to I18n, otherwise it the original parameter is used.</p>
<p>That way the t method can use &#8220;dmy_with_long_month&#8221;, :dmy_with_long_month and any other arbitrary format like &#8220;%B %Y&#8221; that is not defined in any language file.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=288&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_288" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/02/12/localizing-dates-and-time-with-rails-i18n-using-procs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Different day, same shit: MySQL Gem again</title>
		<link>http://info.michael-simons.eu/2008/12/11/different-day-same-shit-mysql-gem-again/</link>
		<comments>http://info.michael-simons.eu/2008/12/11/different-day-same-shit-mysql-gem-again/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 08:25:37 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=247</guid>
		<description><![CDATA[Again, the MySQL ruby gem totally annyoed me trying to install it on a fresh Mac OS X 10.5.5 install and MySQL 5.0.67. This time the following command brought it to life: sudo env ARCHFLAGS=&#34;-arch i386&#34; gem install mysql -- \ --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \ --with-mysql-include=/usr/local/mysql/include Thanks to a bitter software engineer. Share This]]></description>
			<content:encoded><![CDATA[<p>Again, the MySQL ruby gem <a href="http://info.michael-simons.eu/2006/05/05/ruby-on-rails-mit-mac-os-x/">totally</a> <a href="http://info.michael-simons.eu/2007/01/02/ruby-on-rails-native-mysql-bindings-vs-rmagick/">annyoed</a> me trying to install it on a fresh Mac OS X 10.5.5 install and MySQL 5.0.67.</p>
<p>This time the following command brought it to life:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">env</span> <span style="color: #007800;">ARCHFLAGS</span>=<span style="color: #ff0000;">&quot;-arch i386&quot;</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql <span style="color: #660033;">--</span> \
  <span style="color: #660033;">--with-mysql-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">--with-mysql-lib</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>lib \
  <span style="color: #660033;">--with-mysql-include</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>include</pre></div></div>

<p>Thanks to a <a href="http://wonko.com/post/how-to-install-the-mysqlruby-gem-on-mac-os-x-leopard">bitter software engineer</a>.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=247&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_247" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/12/11/different-day-same-shit-mysql-gem-again/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PDF::Writer and Ruby on Rails 2.2.2</title>
		<link>http://info.michael-simons.eu/2008/11/24/pdfwriter-and-ruby-on-rails-222/</link>
		<comments>http://info.michael-simons.eu/2008/11/24/pdfwriter-and-ruby-on-rails-222/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 11:40:04 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Code Snippets]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=234</guid>
		<description><![CDATA[If you followed the instructions here and used the method named PDF::Writer (Austin Ziegler), you we&#8217;re out of luck when Rails 2.1 appeared. With Rails 2.2.2 once again the rendering mechanism seems to have changed big time and my previous post on how to make the pdf/writer gem work with a custom template handler doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>If you followed the instructions <a href="http://wiki.rubyonrails.org/rails/pages/HowtoGeneratePDFs">here</a> and used the method named <em>PDF::Writer (Austin Ziegler)</em>, you we&#8217;re out of luck when <a href="http://info.michael-simons.eu/2008/06/04/pdfwriter-and-ruby-on-rails-21/">Rails 2.1</a> appeared.</p>
<p>With Rails 2.2.2 once again the rendering mechanism seems to have changed big time and my previous post on how to make the pdf/writer gem work with a custom template handler doesn&#8217;t work anymore.</p>
<p>With the help of <a href="http://joshpeek.com/">Josh Peek</a> i was able to fix this. He gave me the following code to enable a rpdf template handler with pdf-writer:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> ActionView <span style="color:#008000; font-style:italic;"># :nodoc:</span>
  <span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'pdf/writer'</span>
  <span style="color:#9966CC; font-weight:bold;">class</span> PDFRender <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActionView::TemplateHandler</span>
    PAPER = <span style="color:#996600;">'A4'</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> ApplicationHelper                     
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">ActionView::Helpers::TranslationHelper</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">ActionView::Helpers::AssetTagHelper</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">ActionView::Helpers::TextHelper</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">ActionView::Helpers::TagHelper</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">ActionView::Helpers::UrlHelper</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span>template<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#996600;">&quot;ActionView::PDFRender.new(self).render(template, local_assigns)&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>action_view<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0066ff; font-weight:bold;">@action_view</span> = action_view
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Render the PDF</span>
    <span style="color:#9966CC; font-weight:bold;">def</span> render<span style="color:#006600; font-weight:bold;">&#40;</span>template, local_assigns = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0066ff; font-weight:bold;">@action_view</span>.<span style="color:#9900CC;">controller</span>.<span style="color:#9900CC;">headers</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;Content-Type&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">||</span>= <span style="color:#996600;">'application/pdf'</span>
&nbsp;
      <span style="color:#008000; font-style:italic;"># Retrieve controller variables</span>
      <span style="color:#0066ff; font-weight:bold;">@action_view</span>.<span style="color:#9900CC;">controller</span>.<span style="color:#9900CC;">instance_variables</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>v<span style="color:#006600; font-weight:bold;">|</span>
        instance_variable_set<span style="color:#006600; font-weight:bold;">&#40;</span>v,
        <span style="color:#0066ff; font-weight:bold;">@action_view</span>.<span style="color:#9900CC;">controller</span>.<span style="color:#9900CC;">instance_variable_get</span><span style="color:#006600; font-weight:bold;">&#40;</span>v<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      pdf = ::<span style="color:#6666ff; font-weight:bold;">PDF::Writer</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#ff3333; font-weight:bold;">:paper</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> PAPER <span style="color:#006600; font-weight:bold;">&#41;</span>
      pdf.<span style="color:#9900CC;">compressed</span> = <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#9966CC; font-weight:bold;">if</span> RAILS_ENV != <span style="color:#996600;">'development'</span>
      <span style="color:#CC0066; font-weight:bold;">eval</span> template.<span style="color:#9900CC;">source</span>, <span style="color:#0000FF; font-weight:bold;">nil</span>, <span style="color:#996600;">''</span>
&nbsp;
      pdf.<span style="color:#9900CC;">render</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">ActionView::Template</span>.<span style="color:#9900CC;">register_template_handler</span> <span style="color:#996600;">'rpdf'</span>, <span style="color:#6666ff; font-weight:bold;">ActionView::PDFRender</span></pre></div></div>

<p>Just drop this under config/initializers and you&#8217;re fine.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=234&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_234" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/11/24/pdfwriter-and-ruby-on-rails-222/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Turn off RoRs automatic timezone conversion for columns</title>
		<link>http://info.michael-simons.eu/2008/11/01/turn-off-rors-automatic-timezone-conversion-for-columns/</link>
		<comments>http://info.michael-simons.eu/2008/11/01/turn-off-rors-automatic-timezone-conversion-for-columns/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 09:15:32 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=225</guid>
		<description><![CDATA[I couldn&#8217;t find this in the documents, but Geoff Buesing showed me the hooks to turn off Ruby On Rails&#8217; automatic timezone conversions for some columns of a model or a complete model: # Turn it off for just some columns class Picture &#60; ActiveRecord::Base def self.skip_time_zone_conversion_for_attributes &#91;:created_at, :published_at&#93; end end &#160; # Turin it [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t find this in the documents, but <a href="http://www.geoffbuesing.com/">Geoff Buesing</a> showed me the hooks to turn off Ruby On Rails&#8217; automatic timezone conversions for some columns of a model or a complete model:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Turn it off for just some columns</span>
<span style="color:#9966CC; font-weight:bold;">class</span> Picture <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
 <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">skip_time_zone_conversion_for_attributes</span>
   <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:created_at</span>, <span style="color:#ff3333; font-weight:bold;">:published_at</span><span style="color:#006600; font-weight:bold;">&#93;</span>
 <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Turin it off for the whole model</span>
<span style="color:#9966CC; font-weight:bold;">class</span> Picture <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
 <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">time_zone_aware_attributes</span>
   <span style="color:#0000FF; font-weight:bold;">false</span>
 <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Thanks a lot!</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=225&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_225" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/11/01/turn-off-rors-automatic-timezone-conversion-for-columns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.568 seconds -->

