<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: DRY code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 18 May 2008 15:42:26 GMT</pubDate>
    <description>DZone Snippets: DRY code</description>
    <item>
      <title>DRYing up YAML fixtures</title>
      <link>http://snippets.dzone.com/posts/show/3114</link>
      <description>// Rails Recipes explained how to DRY up the database configuration code. I applied the same idea to user fixtures, which worked while we used MySQL. Once on Postgres, "defaults" started throwing an error. The easiest solution was to make quentin's values the 'defaults'&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;quentin: &amp;defaults&lt;br /&gt;  id: 1&lt;br /&gt;  login: quentin&lt;br /&gt;  email: quentin@example.com&lt;br /&gt;  site_id: 1&lt;br /&gt;  salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd&lt;br /&gt;  crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test&lt;br /&gt;  created_at: &lt;%= 5.days.ago.to_s :db %&gt;&lt;br /&gt;  activated_at: &lt;%= 5.days.ago.to_s :db %&gt; # only if you're activating new signups&lt;br /&gt;aaron:&lt;br /&gt;  id: 2&lt;br /&gt;  login: aaron&lt;br /&gt;  email: aaron@example.com&lt;br /&gt;  activation_code: aaronscode&lt;br /&gt;  site_id: 1&lt;br /&gt;  &lt;&lt;: *defaults&lt;br /&gt;#etc...&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 09 Dec 2006 03:12:44 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3114</guid>
      <author>chebuctonian (Daniel Haran)</author>
    </item>
    <item>
      <title>DRY RAILS database.yml config file</title>
      <link>http://snippets.dzone.com/posts/show/2263</link>
      <description>From http://blog.bleything.net/articles/2006/06/27/dry-out-your-database-yml:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;login: &amp;login&lt;br /&gt;  adapter: mysql&lt;br /&gt;  username: username&lt;br /&gt;  password: password&lt;br /&gt;  host: mysql.example.com&lt;br /&gt;&lt;br /&gt;development:&lt;br /&gt;  &lt;&lt;: *login&lt;br /&gt;  database: app_dev&lt;br /&gt;&lt;br /&gt;test:&lt;br /&gt;  &lt;&lt;: *login&lt;br /&gt;  database: app_test&lt;br /&gt;&lt;br /&gt;production:&lt;br /&gt;  &lt;&lt;: *login&lt;br /&gt;  database: app_prod&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 10 Jul 2006 05:15:02 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2263</guid>
      <author>MattScilipoti (Matt Scilipoti)</author>
    </item>
  </channel>
</rss>
