<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Snippets for fixtures</title>
		<link>http://www.bytemycode.com</link>
		<description>Snippets for this tag.</description>
		<pubDate>Sun, 12 Oct 2008 09:47:03 +0000</pubDate>
		<copyright>1998-2008 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	<item>
	<title>Creating a fixture via ActiveRecord</title>
	<link>http://www.bytemycode.com/snippets/snippet/586/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/586/comments/</comments>
	<pubDate>Thu, 08 Feb 2007 13:09:14 +0000</pubDate>
	<dc:creator>jeremec</dc:creator>
	<category>"ruby on rails", fixtures, rails, Ruby</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/586/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Thu. Feb. 8th, 2007  1:09 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/586/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/jeremec/" title="Helper">jeremec</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%22ruby+on+rails%22">"ruby on rails"</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/fixtures">fixtures</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/rails">rails</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Ruby">Ruby</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/586/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>I'm in the process of writing test fixtures for our rails site.  A lot of my tests require authentication, so I've had to port our permissions system into a fixture.  Rather than type out all of the information for the fixture, I decided to create a nested loop that will take care of this for me.<br /><br />There's probably a rake task for this, but I wasn't able to find it, so I came up with my own solution.  You'll have to do a little cleanup when it's done, however some slight mods to this loop could even eliminate that.<img src="http://www.bytemycode.com/img/wysiwyg/emo-eek.gif" /></p>
		]]>
	</description>
</item>
	</channel>
</rss>