<?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>Wylie &#187; fixtures</title>
	<atom:link href="http://www.wyliethomas.com/blog/tag/fixtures/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wyliethomas.com/blog</link>
	<description>web consultant.developer.angler</description>
	<lastBuildDate>Wed, 07 Dec 2011 18:14:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>I finally used fixtures</title>
		<link>http://www.wyliethomas.com/blog/2009/07/20/i-finally-used-fixtures/</link>
		<comments>http://www.wyliethomas.com/blog/2009/07/20/i-finally-used-fixtures/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 03:11:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[fixtures]]></category>

		<guid isPermaLink="false">http://www.wyliethomas.com/blog/2009/07/20/i-finally-used-fixtures/</guid>
		<description><![CDATA[I finally had a project where I thought fixtures and unit testing made sense and now I&#8217;m wondering why wasn&#8217;t I doing this all along?
I have been using rake migrations pretty much since I started using RoR. But default data hasnt been much of an issue on my projects until this last one. So I [...]]]></description>
			<content:encoded><![CDATA[<p>I finally had a project where I thought fixtures and unit testing made sense and now I&#8217;m wondering why wasn&#8217;t I doing this all along?</p>
<p>I have been using rake migrations pretty much since I started using RoR. But default data hasnt been much of an issue on my projects until this last one. So I looked into fixtures and Im regretting not taking the time sooner to get to know fixtures better.</p>
<p>One cool thing I came accross was how to handle foriegn keys when loading fixtures. It kept choking on fixtures:load because by default it will load fixtures in alphabetical order. For example: My fixture for accounts has a FK of user_id but the accounts fixture will be loaded before the users fixture is. Thus my FK problem.</p>
<p>I found some clever ruby scripts that alter the ENV variables and so on but i thought a more direct approach was to just run it like this</p>
<p><code>rake db:fixtures:load FIXTURES=users,accounts</code></p>
<p>Pretty cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wyliethomas.com/blog/2009/07/20/i-finally-used-fixtures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

