<?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>uRaNGaTaNG &#187; fork</title>
	<atom:link href="http://www.rngtng.com/tag/fork/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rngtng.com</link>
	<description>TobiTobes Tech Weblog featuring Ruby, Rails, Web development, Arduino, Processing, Geekstuff and more...</description>
	<lastBuildDate>Thu, 01 Jul 2010 11:36:10 +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>Rails flag_shih_tzu Plugin with named_scope</title>
		<link>http://www.rngtng.com/2009/08/20/rails-flag_shih_tzu-plugin-with-named_scope/</link>
		<comments>http://www.rngtng.com/2009/08/20/rails-flag_shih_tzu-plugin-with-named_scope/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 17:02:36 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Ruby, Rails & Co.]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=200</guid>
		<description><![CDATA[When it comes to store a load of boolean data into your model you easily end up with lots of columns which blow up your table unnecessarily. The developers at Xing solved this problem with a nifty Rails Plugin called flag_shih_tzu. The trick is to store all boolean values combined as a bit vector, which [...]]]></description>
			<content:encoded><![CDATA[<p>When it comes to store a load of boolean data into your model you easily end up with lots of columns which blow up your table unnecessarily. The developers at <a href="http://blog.xing.com/category/tech-blog">Xing</a> solved this problem with a nifty Rails Plugin called <a href="http://github.com/xing/flag_shih_tzu/">flag_shih_tzu</a>. The trick is to store all boolean values combined as a bit vector, which allows you to put up to 32 values (4Byte) within a single Integer column. Automatic generated access methods allows you to deal with you model as your are used to. Wanna see an example? (Taken from plugin docs)</p>
<pre class="brush: ruby;">
class Spaceship &lt; ActiveRecord::Base
  include FlagShihTzu

  has_flags 1 =&gt; :warpdrive,
            2 =&gt; :shields

end

enterprise = Spaceship.new
enterprise.warpdrive = true
enterprise.shields = false
enterprise.save

enterprise.warpdrive? #=&gt; true
enterprise.shields? # =&gt; false
</pre>
<p>Nice, isn&#8217;t it?</p>
<p>Unfortunately named scopes where missing for selecting models easily. So another github fork, another fix, and here were are. Now this works as well:</p>
<pre class="brush: ruby;">
Spaceship.flagged(:warpdrive).not_flagged(:shields).all
</pre>
<p>Check it out here: <a href="http://github.com/rngtng/flag_shih_tzu/tree/master" target="_blank">http://github.com/rngtng/flag_shih_tzu/tree/master</a></p>
<p><strong>Update:</strong> replaced &#8216;routes&#8217; with &#8216;scopes&#8217; &#8211; I&#8217;m getting confused with that all the time, how come!? <img src='http://www.rngtng.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2009/08/20/rails-flag_shih_tzu-plugin-with-named_scope/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My first GitHub fork: bounce-email</title>
		<link>http://www.rngtng.com/2009/06/05/my-first-github-fork-bounce-email/</link>
		<comments>http://www.rngtng.com/2009/06/05/my-first-github-fork-bounce-email/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 12:40:12 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Ruby, Rails & Co.]]></category>
		<category><![CDATA[bounce]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[Rails & Co.]]></category>
		<category><![CDATA[tmail]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=102</guid>
		<description><![CDATA[Hurray! I finally forked a github project. Yesterday I ran into the bounce-email gem by Agris Ameriks on Rubyforge. It&#8217;s basically a 1:1 port of the PHP Bounce Handler classby Chris Fortune and not very rubyified. Thanks to David Reese, bounce-email is forked on github and I could easily extend it. I rubyfied the class, [...]]]></description>
			<content:encoded><![CDATA[<p>Hurray! I finally forked a github project. Yesterday I ran into the <a href="http://rubyforge.org/projects/bounce-email/">bounce-email gem</a> by Agris Ameriks on Rubyforge. It&#8217;s basically a 1:1 port of the <a href="http://www.phpclasses.org/browse/package/2691.html">PHP Bounce Handler class</a>by Chris Fortune and not very rubyified. Thanks to David Reese, <a href="http://github.com/whatcould/bounce-email/tree/master">bounce-email is forked on github </a> and I could easily extend it.</p>
<p>I rubyfied the class, did some code cleanup, added (yet a very simple) way to get the  original message, and gained some performance by paring message only on demand. A testcase was broken as well the Rakefile, both are fixed. See the update here:<br />
<a href="http://github.com/rngtng/bounce-email/tree/master">http://github.com/rngtng/bounce-email/tree/master</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2009/06/05/my-first-github-fork-bounce-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
