<?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>weedygarden.net &#187; Rails</title>
	<atom:link href="http://www.weedygarden.net/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weedygarden.net</link>
	<description>The random ramblings of a web developer.</description>
	<lastBuildDate>Mon, 25 Jan 2010 02:16:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A Note on ActiveRecord Serialization and Objects</title>
		<link>http://www.weedygarden.net/2009/04/19/a-note-on-activerecord-serialization-and-objects/</link>
		<comments>http://www.weedygarden.net/2009/04/19/a-note-on-activerecord-serialization-and-objects/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 11:56:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.weedygarden.net/?p=53</guid>
		<description><![CDATA[Let&#8217;s say you&#8217;re serializing a ruby object for later use in a field of another model. class Foo &#60; ActiveRecord::Base serialize :bar end In this instance, assume an object of type &#8220;Bar&#8221; is what&#8217;s being serialized. After save, the data appears fine, but when you retrieve the data, instead of your Object you end up [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you&#8217;re serializing a ruby object for later use in a field of another model.</p>
<pre><code>class Foo &lt; ActiveRecord::Base
  serialize :bar
end</code></pre>
<p>In this instance, assume an object of type &#8220;Bar&#8221; is what&#8217;s being serialized. After save, the data appears fine, but when you retrieve the data, instead of your Object you end up with yaml that looks like this:</p>
<pre>[#&lt;YAML::Object:0x3fcade8 @ivars={"attributes_cache"=&gt;{}, "attributes"=&gt;{"updated_at"=&gt;"2008-11-04 19:33:05", "id"=&gt;"1", "message"=&gt;"Hello World!", "created_at"=&gt;"2008-11-04 19:33:05"}}, @class="Bar"&gt;</pre>
<p>This most likely means that the model of the object being serialized is not loaded yet. This can be resolved by simply doing:</p>
<pre><code>class Foo &lt; ActiveRecord::Base
  Bar

  serialize :bar
end</code></pre>
<p>This will load the model before serialization occurs and you&#8217;ll be all set.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weedygarden.net/2009/04/19/a-note-on-activerecord-serialization-and-objects/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Tale of Woe: starring Rails 2.2, Mac OS X and a MySQL Upgrade</title>
		<link>http://www.weedygarden.net/2009/01/13/a-tale-of-woe-starring-rails-22-mac-os-x-and-a-mysql-upgrade/</link>
		<comments>http://www.weedygarden.net/2009/01/13/a-tale-of-woe-starring-rails-22-mac-os-x-and-a-mysql-upgrade/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 02:14:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.weedygarden.net/?p=39</guid>
		<description><![CDATA[If you&#8217;ve used Rails 2.1 at all, you will no doubt be aware due to the incessant notifications, that Rails 2.2 will be dropping its MySQL driver. Therefore, in order to use Rails 2.2, you will need to install an updated version of MySQL. I found one good resource that got me most of the [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve used Rails 2.1 at all, you will no doubt be aware due to the incessant notifications, that Rails 2.2 will be dropping its MySQL driver. Therefore, in order to use Rails 2.2, you will need to install an updated version of MySQL. I found <a href="http://craiccomputing.blogspot.com/2008/11/installing-rails-22-on-mac-os-x-mysql.html">one good resource</a> that got me most of the way there, however, after the upgrade, most of my tests, in all of my apps were failing.</p>
<p>While trying to figure out what was going on, a couple of things became apparent. If I moved tests around or deleted specific tests (mainly update and destroy tests), it caused previously failing tests to pass. Also, setting &#8220;self.use_transactional_fixtures&#8221; to false in &#8220;test_helper.rb&#8221; caused most tests to pass. As I was checking on that further in one of my apps (one that I didn&#8217;t delete all the comments from), I noticed this:</p>
<blockquote><p>&#8220;Every Active Record database supports transactions except MyISAM tables in MySQL.  Turn off transactional fixtures in this case; however, if you don&#8217;t care one way or the other, switching from MyISAM to InnoDB tables is recommended.&#8221;</p></blockquote>
<p>Cue the lightbulb.</p>
<p>Jumping into mysql and running &#8220;show engines;&#8221; confirmed the bulb. InnoDB was disabled. So now we ned to remedy this little problem.</p>
<p>If you already have a &#8216;my.cnf&#8217; file, you&#8217;re ahead of the class, so please hold on while the rest of us catch up.</p>
<p>The MySQL package installer drops mysql in:</p>
<pre>/usr/local/mysql</pre>
<p>If you look in the support-files directory, they have several my.cnf sample files. So now we need to get one of these into play.</p>
<p>Copy</p>
<pre>/usr/local/mysql/support-files/my-medium.cnf</pre>
<p>to</p>
<pre>/etc/my.cnf</pre>
<p>At this time I&#8217;d like to welcome back those of you who already had a my.cnf file.</p>
<p>Now open your my.cnf file and uncomment the lines that start with &#8220;innodb_&#8221; (starting at line 123 in my config file). Save the file and restart MySQL. If you go back into mysql and rerun &#8220;show engines;&#8221;, you should now see InnoDB support has been enabled.</p>
<p>Now when you run your tests, all should be well in the world again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weedygarden.net/2009/01/13/a-tale-of-woe-starring-rails-22-mac-os-x-and-a-mysql-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I Learned Today About ActionView</title>
		<link>http://www.weedygarden.net/2009/01/06/what-i-learned-today-about-actionview/</link>
		<comments>http://www.weedygarden.net/2009/01/06/what-i-learned-today-about-actionview/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 03:14:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.weedygarden.net/?p=35</guid>
		<description><![CDATA[I ran across a couple of ActionView tidbits that were new to me, so I thought I'd share.]]></description>
			<content:encoded><![CDATA[<p>I ran across a couple of ActionView tidbits that were new to me, so I thought I&#8217;d share.</p>
<p>You can comment out ERb delimiters in your view by adding a pound sign before the equal sign.</p>
<pre><code class="erb">
&lt;%#= str %&gt;
</code></pre>
<p>When rendering a collection, you have access to a zero-based &#8220;partial_<em>counter</em>&#8221; variable that increments on each iteration.</p>
<pre><code class="erb">
&lt;%= div_for(entry) do %&gt;
	&lt;%= entry_counter %&gt;
&lt;% end  %&gt;
</code></pre>
<p>Todays lesson brought you by chapter 10 of &#8220;The Rails Way&#8221; by Obie Fernandez.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weedygarden.net/2009/01/06/what-i-learned-today-about-actionview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails reference for PHP programmers</title>
		<link>http://www.weedygarden.net/2008/04/16/rails-reference-for-php-programmers/</link>
		<comments>http://www.weedygarden.net/2008/04/16/rails-reference-for-php-programmers/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 11:50:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.weedygarden.net/?p=20</guid>
		<description><![CDATA[Back when I first started with Rails, I noticed there were a lot of times I just needed to know the Ruby/Rails equivalent of some PHP function. It started me thinking that it would be great to have a resource similar to PHP.net where you could just append the function name to the end of [...]]]></description>
			<content:encoded><![CDATA[<p>Back when I first started with Rails, I noticed there were a lot of times I just needed to know the Ruby/Rails equivalent of some PHP function. It started me thinking that it would be great to have a resource similar to PHP.net where you could just append the function name to the end of a url, and get some relevant Ruby/Rails examples. Well, <a title="Rails for PHP Developers" href="http://railsforphp.com/reference/">somebody beat me to it</a>.</p>
<p>The folks over at <a title="Rails for PHP Developers" href="http://railsforphp.com">Rails for PHP Developers</a> have a pretty good start on content, especially for Array, String and Filesystem functions. The feature I was planning on, which I am not seeing their site, is a way for the community to contribute. Even if it were heavily moderated, I think it would be a boon for the site to flesh out its reference much more quickly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weedygarden.net/2008/04/16/rails-reference-for-php-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
