<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Maulana Ruby</title>
	<atom:link href="http://maulanaruby.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://maulanaruby.wordpress.com</link>
	<description>Blog of Pakistan's foremost Rubyist</description>
	<lastBuildDate>Wed, 04 Feb 2009 19:32:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='maulanaruby.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Maulana Ruby</title>
		<link>http://maulanaruby.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://maulanaruby.wordpress.com/osd.xml" title="Maulana Ruby" />
	<atom:link rel='hub' href='http://maulanaruby.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Getting started with engines development in rails 2.3</title>
		<link>http://maulanaruby.wordpress.com/2009/02/04/getting-started-with-engines-development-in-rails-23/</link>
		<comments>http://maulanaruby.wordpress.com/2009/02/04/getting-started-with-engines-development-in-rails-23/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 19:26:15 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby Language]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/2009/02/04/getting-started-with-engines-development-in-rails-23/</guid>
		<description><![CDATA[Rails 2.3 RC1 has just been released. There are number of new features like application templates, Metal points, Rack integration and support for Engines. Earlier engines plugins were not in much favour. But now since merb has similar feature in form of slices they have recently been back in favour and now the engines have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=27&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3/"></a>Rails 2.3 RC1 has just been <a href="http://weblog.rubyonrails.org/2009/2/1/rails-2-3-0-rc1-templates-engines-rack-metal-much-more" target="_blank">released</a>. There are number of new features like application templates, Metal points, Rack integration and support for Engines. Earlier engines plugins were not in much favour. But now since merb has similar feature in form of slices they have recently been back in favour and now the engines have made it to core. but not all feature has been ported as pointed out by <a href="http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3/">post</a> on rails engines site.</p>
<p>Lets get started with developing a simple plugin that uses engines feature of rails 2.3 RC1. This tutorial is based on rails flickr demo application. lets install latest 2.3 gems on your machine.</p>
<p><code><br />
gem install rails --source http://gems.rubyonrails.org<br />
</code></p>
<p>Lets generate empty rails application and run plugin generator. There is no seperate generator for engines as engine plugin is type of plugin. Lets call our plugin flickr_search from application root issue this command</p>
<p><code><br />
$ script/generate plugin flickr_search<br />
</code></p>
<p>This will generate a flickr_search folder in vendor/plugin which contains whole bunch of files which is empty skeleton for new plugin. since our plugin is based on flickr api you need to install flickr gem and get API key from <a href="http://www.flickr.com/services/api/misc.api_keys.html" target="_blank">http://www.flickr.com/services/api/misc.api_keys.html</a>.</p>
<p><code><br />
$ sudo gem install flickr<br />
</code></p>
<p>Now edit init.rb file in flickr_search folder and write out this code. Make sure you replace your API key in code</p>
<p><code><br />
require 'rubygems'<br />
require 'flickr'<br />
MY_KEY='Enter your Flicker API Key'<br />
class Flickr<br />
alias old_initialize initialize<br />
def initialize(api_key=MY_KEY, email=nil, password=nil)<br />
puts "new_initialize " + MY_KEY<br />
old_initialize(api_key, email, password)<br />
@host="http://api.flickr.com"<br />
@activity_file='flickr_activity_cache.xml'<br />
end<br />
end<br />
</code></p>
<p>With engines support in rails you can have same app folders in your plugin as well. so lets create app folder in flickr_search folder also create sub folders like controller, views, models and helpers as in any rails application. Lets create a controller file in controllers folder called flickr_controller.rb and create index action. Noew in views folder create layout folder and add layout file called flickrlayout.html.erb. Add this code to layout<br />
<code><br />
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Flickr&lt;/title&gt;<br />
&lt;%= javascript_include_tag :defaults %&gt;<br />
&lt;%= stylesheet_link_tag 'flickr' %&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;%= yield %&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
<p>Notice that the code has some asset helpers. currently rails does not have support for seperate assets for plugin so we need to copy these style sheets and other assets to rails public directory. This can easily be done by writing few lines of code in install.rb file. but in our case we will simply create flickr.css file in public/stylesheets directory of main rails application. so lets create this file and copy these styles in it.</p>
<p><code><br />
body {<br />
background-color: #888;<br />
font-family: Lucida Grande;<br />
font-size: 11px;<br />
margin: 25px;<br />
}</p>
<p>form {<br />
margin: 0;<br />
margin-bottom: 10px;<br />
background-color: rgb(222,231,236);<br />
border: 5px solid #333;<br />
padding: 25px;<br />
}</p>
<p>fieldset {<br />
border: none;<br />
}</p>
<p>#spinner {<br />
float: right;<br />
margin: 10px;<br />
}</p>
<p>#photos img {<br />
border: 1px solid #000;<br />
width: 75px;<br />
height: 75px;<br />
margin: 5px;<br />
}<br />
</code></p>
<p>Lets create a view for searching flickr images. In app/views directory of you plugin create index.html.erb file. Copy this code in it</p>
<p><code><br />
&lt;% form_remote_tag :url =&gt; {:action =&gt; 'search'}, :update =&gt; 'photos' do %&gt;<br />
&lt;fieldset&gt;<br />
&lt;label for="tags"&gt;Tags:&lt;/label&gt;</p>
<p>&lt;%= text_field_tag 'tags' %&gt;<br />
&lt;%= submit_tag 'Find' %&gt;<br />
&lt;/fieldset&gt;</p>
<p>&lt;div id="photos"&gt;&lt;/div&gt;<br />
&lt;% end %&gt;<br />
</code></p>
<p>Create a search action in flickr_controller.rb file that gets called by AJAX action in index.html.erb view. Now your controller code should look like this</p>
<p><code><br />
class FlickrController &lt; ApplicationController</p>
<p>layout "flickrlayout"</p>
<p>def index<br />
end</p>
<p>def search<br />
flickr = Flickr.new</p>
<p>if params[:tags].empty?<br />
render :text =&gt; '&lt;h2&gt;Please enter a search string&lt;/h2&gt;'<br />
else<br />
begin<br />
photos = flickr.photos(:tags =&gt; params[:tags], :per_page =&gt; '24')<br />
render :partial =&gt; 'photo', :collection =&gt; photos<br />
rescue NoMethodError<br />
render :text =&gt; '&lt;h2&gt;No matching photos found&lt;/h2&gt;'<br />
end<br />
end<br />
end<br />
end<br />
</code></p>
<p>Also create _photo.html.erb partial in views/flickr folder. this will contain this line of code</p>
<p><code><br />
&lt;img class='photo' src="&lt;%= photo.sizes[0]['source'] %&gt;"&gt;<br />
</code></p>
<p>With engine you can also add routes with routes.rb file. so lets create config folder in plugin root folder and add routes.rb file. you can add custom route for flickr search here</p>
<p><code><br />
ActionController::Routing::Routes.draw do |map|<br />
map.pics '/pics', :controller =&gt; 'flickr'<br />
end<br />
</code></p>
<p>Now go ahead and run your application the flickr search should be working on <a href="http://0.0.0.0:3000/pics">http://0.0.0.0:3000/pics</a></p>
<p>One thing about migrations there is still no way to have seperate migration in engines plugin you would still need to generate and copy migrations to main applications db/migrate folder.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=27&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2009/02/04/getting-started-with-engines-development-in-rails-23/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>What you think about merger of merb and rails</title>
		<link>http://maulanaruby.wordpress.com/2009/01/02/what-you-think-about-merger-of-merb-and-rails/</link>
		<comments>http://maulanaruby.wordpress.com/2009/01/02/what-you-think-about-merger-of-merb-and-rails/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 11:29:02 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby Language]]></category>
		<category><![CDATA[Ruby on rails]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/?p=24</guid>
		<description><![CDATA[I think that development of merb should continue independently as well. what do you think?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=24&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I think that development of merb should continue independently as well. what do you think?</p>
<a href="http://polldaddy.com/poll/1239655/">View This Poll</a>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=24&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2009/01/02/what-you-think-about-merger-of-merb-and-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>First version of rails with threat safety is here</title>
		<link>http://maulanaruby.wordpress.com/2008/11/22/first-version-of-rails-with-threat-safety-is-here/</link>
		<comments>http://maulanaruby.wordpress.com/2008/11/22/first-version-of-rails-with-threat-safety-is-here/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 15:14:15 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby Language]]></category>
		<category><![CDATA[Ruby on rails]]></category>
		<category><![CDATA[JRuby]]></category>
		<category><![CDATA[Merb]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/?p=20</guid>
		<description><![CDATA[Rails 2.2 was released yesterday which happens to be first version to support thread safety. Previously lack of threads in rails has been cause of scalabilty concerns especially with twitter problems coming to limelight. So new version of rails will solve these issue? &#8220;Not so fast!&#8221; says most of people in ruby community. One of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=20&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Rails 2.2 was released yesterday which happens to be first version to support thread safety. Previously lack of threads in rails has been cause of scalabilty concerns especially with <a href="http://www.techcrunch.com/2008/05/22/twitter-at-scale-will-it-work/">twitter problems coming to limelight</a>. So new version of rails will solve these issue? &#8220;Not so fast!&#8221; says most of people in ruby community.</p>
<p>One of the main reasons why not all new rails application will become multi threaded overnight is native libraries (i.e mysql client library etc). All most all rails applications use these libraries and these libraries block ruby intrpreter from calling these libraries with multiple threads. One answer to this problem is <a href="http://www.igvita.com/2008/10/27/scaling-activerecord-with-mysqlplus/">Mysql Plus library</a> which uses never block api.</p>
<p>Another issue with rails multi threading is that it is being added as after thought and has not been extensively tested. if you really has to develop multi threaded ruby web application i think you should go with merb. The <a href="http://blog.engineyard.com/2008/11/08/merb-1-0-released">merb 1.0 was recently released</a> as well. There are some open source multi threaded applications already out there.</p>
<p>Another issue threads support in Ruby VM. Current Ruby 1.8 VM does not support native threads but next version of Ruby 1.9 VM will support native threads. JRuby VM currently has much more support for threading and it is expected that both Merb and future version of Rails will have great performance and scalibility on JRuby VM. Upcoming Java 7 Runtime will have additional support for hosted dynamic languages like JRuby and Jython which will address many concerns about performance of JVM hosted languages like Groovy, Scala and JRuby.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=20&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2008/11/22/first-version-of-rails-with-threat-safety-is-here/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>Simplicant Goes into Public Beta</title>
		<link>http://maulanaruby.wordpress.com/2008/04/21/simplicant-goes-into-public-beta/</link>
		<comments>http://maulanaruby.wordpress.com/2008/04/21/simplicant-goes-into-public-beta/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 12:46:17 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby Language]]></category>
		<category><![CDATA[Ruby on rails]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/2008/04/21/simplicant-goes-into-public-beta/</guid>
		<description><![CDATA[The public beta of Simplicant was officially released few days ago. As a follow up to my previous post . Here is some details according to official press release. Simplicant allows SMEs to move towards a more organized, cleaner job applications management system. simplicant is the first web 2.0 applicant tracking system and brings the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=18&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The public beta of Simplicant was officially released few days ago. As a follow up to my previous <a href="http://maulanaruby.wordpress.com/2007/09/08/simplicant-public-beta-will-be-launched-soon/">post</a> . Here is some details according to official press release.</p>
<blockquote cite="http://www.prweb.com/releases/2008/04/prweb866764.htm"><p>Simplicant allows SMEs to move towards a more organized, cleaner job applications management system. simplicant is the first web 2.0 applicant tracking system and brings the spirit of web 2.0 into hiring. It is completely web-based (Software as a Service) and makes use of powerful web 2.0 concepts like tags, rankings, search and collaboration to make the hiring experience easier, smoother and quicker.</p>
<p>Here is link to official press release:</p>
<p><cite><br />
<a href="http://www.prweb.com/releases/2008/04/prweb866764.htm">Simplicant Goes into Public Beta</a>&nbsp;<br />
</cite></p></blockquote>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/RubyLanguage" rel="tag">RubyLanguage</a>, <a href="http://technorati.com/tag/%20Ruby%20on%20rails" rel="tag"> Ruby on rails</a>, <a href="http://technorati.com/tag/%20Web%202.0" rel="tag"> Web 2.0</a></p>
<p><!-- technorati tags end --></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/maulanaruby.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/maulanaruby.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=18&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2008/04/21/simplicant-goes-into-public-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>BitNami JRubyStack makes JRuby on Rails setup simple</title>
		<link>http://maulanaruby.wordpress.com/2008/03/18/bitnami-jrubystack-makes-jruby-on-rails-setup-simple/</link>
		<comments>http://maulanaruby.wordpress.com/2008/03/18/bitnami-jrubystack-makes-jruby-on-rails-setup-simple/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 07:43:42 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby on rails]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/2008/03/18/bitnami-jrubystack-makes-jruby-on-rails-setup-simple/</guid>
		<description><![CDATA[BitNami JRubyStack makes JRuby on Rails setup simple. The stack comes bundled with JRuby, Rails, Tomcat, Glassfish Gem, Mysql and Subversion. You can run your Rails app either with Glassfish or make a war and deloy to tomcat. The whole package is distributed under Apache 2.0 License. There has been few sites that use JRuby [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=17&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://bitnami.org/stack/jrubystack">BitNami JRubyStack</a> makes JRuby on Rails setup simple. The stack comes bundled with JRuby,  Rails, Tomcat, Glassfish Gem, Mysql and Subversion. You can run your Rails app either with Glassfish or make a war and deloy to tomcat. The whole package is distributed under Apache 2.0 License.</p>
<p>There has been few sites that use JRuby proving that JRuby does scale. Thoughtworks project management application <a href="http://studios.thoughtworks.com/mingle-project-intelligence">mingle</a> is powered by JRuby and Rails. Sun <a href="http://mediacast.sun.com/">mediacast</a> site is also now running on JRuby and Rails<!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/jruby" rel="tag">jruby</a>, <a href="http://technorati.com/tag/Rails" rel="tag">Rails</a></p>
<p><!-- technorati tags end --></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/maulanaruby.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/maulanaruby.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=17&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2008/03/18/bitnami-jrubystack-makes-jruby-on-rails-setup-simple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>Matz talks about Ruby 1.9 (Yarv)</title>
		<link>http://maulanaruby.wordpress.com/2008/03/18/matz-talks-about-ruby-19-yarv/</link>
		<comments>http://maulanaruby.wordpress.com/2008/03/18/matz-talks-about-ruby-19-yarv/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 06:41:07 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby Language]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[yarv]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/?p=16</guid>
		<description><![CDATA[Matz talks about new Ruby version. Ruby 1.9 beta was released on christmas day at 25 december 2007. Matz presents about new ruby version at google conference. The new version was earlier known as Yet Another Ruby Virtual machine (YARV). The main feature of Ruby 1.9 is support for platform threads. The Tread class in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=16&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Matz talks about new Ruby version. Ruby 1.9 beta was released on christmas day at 25 december 2007. <span style="text-align:center; display: block;"><a href="http://maulanaruby.wordpress.com/2008/03/18/matz-talks-about-ruby-19-yarv/"><img src="http://img.youtube.com/vi/oEkJvvGEtB4/2.jpg" alt="" /></a></span><br />
Matz presents about new ruby version at google conference. The new version was earlier known as Yet Another Ruby Virtual machine (YARV). The main feature of Ruby 1.9 is support for platform threads. The Tread class in earlier Ruby VM&#8217;s were green threads.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/maulanaruby.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/maulanaruby.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=16&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2008/03/18/matz-talks-about-ruby-19-yarv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>Simplicant Public Beta will be launched soon</title>
		<link>http://maulanaruby.wordpress.com/2007/09/08/simplicant-public-beta-will-be-launched-soon/</link>
		<comments>http://maulanaruby.wordpress.com/2007/09/08/simplicant-public-beta-will-be-launched-soon/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 09:02:45 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby Language]]></category>
		<category><![CDATA[Ruby on rails]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/2007/09/08/simplicant-public-beta-will-be-launched-soon/</guid>
		<description><![CDATA[It has been almost an year since my first Ruby on Rails project was launced as private beta. The Simplicant is simplest web based applicant tracking system. Based on years of experience in hiring of medium and small companies, simplicant gives you headstart when you want hire applicants in your comapnies. This Applicant tracking system not only allows you to post jobs on job board and recieve resumes, but also allows you to ask questions before you interview the applicant. After interview simplicant allows you to communicate with applicants   Simplicant has been totally overhauled  for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=14&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It has been almost an year since my first <a HREF="http://www.rubyonrails.org">Ruby on Rails</a> project was launced as private beta. The <a HREF="http://www.simplicant.com">Simplicant </a> is simplest web based applicant tracking system. Based on years of experience in hiring of medium and small companies, <a HREF="http://www.simplicant.com">simplicant</a> gives you headstart when you want hire applicants in your comapnies. This Applicant tracking system not only allows you to post jobs on job board and recieve resumes, but also allows you to ask questions before you interview the applicant. After interview simplicant allows you to communicate with applicants</p>
<p><a HREF="http://maulanaruby.files.wordpress.com/2007/09/simplicant_logo.gif" TITLE="the Simplest applicant tracking system on web"><img SRC="http://maulanaruby.files.wordpress.com/2007/09/simplicant_logo.gif" ALT="the Simplest applicant tracking system on web" /> </a></p>
<p><a HREF="http://www.simplicant.com">Simplicant</a> has been totally overhauled  for performance and scalability. The web based interface has features that are found in todays Web 2.0 applications.</p>
<p>The company behind <a HREF="http://www.simplicant.com">Simplicant</a> is <a HREF="http://www.confiz.com">confiz solutions</a> which is known for developing many of todays major Web 2.0 apps. The new public beta for will be launched soon.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/maulanaruby.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/maulanaruby.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=14&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2007/09/08/simplicant-public-beta-will-be-launched-soon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>Rubinus &#8211; Smalltalk inspired Ruby VM</title>
		<link>http://maulanaruby.wordpress.com/2007/08/01/rubinus-smalltalk-inspired-ruby-vm/</link>
		<comments>http://maulanaruby.wordpress.com/2007/08/01/rubinus-smalltalk-inspired-ruby-vm/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 06:07:13 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby Language]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/2007/08/01/rubinus-smalltalk-inspired-ruby-vm/</guid>
		<description><![CDATA[Borrowing ideas from smalltalk-80 Evan Phoenix (of EngineYard) has created a new Ruby VM. The VM is written in C with Ruby like syntax. Language known as Garnet (formerly known as Cuby). Most parts of VM are written in Ruby itself except GC , Core VM (opcodes) and Primitives which are written in Garnet. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=13&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Borrowing ideas from smalltalk-80 Evan Phoenix (of EngineYard) has created a new Ruby VM. The VM is written in C with Ruby like syntax. Language known as Garnet (formerly known as Cuby). Most parts of VM are written in Ruby itself except GC , Core VM (opcodes) and Primitives which are written in Garnet.</p>
<iframe src='http://www.slideshare.net/slideshow/embed_code/42361' width='425' height='348'></iframe>
<p>The link to InfoQ article is:</p>
<p><a href="http://www.infoq.com/news/2007/07/rubinius-interview-part-one">http://www.infoq.com/news/2007/07/rubinius-interview-part-one</a></p>
<p>Also look at Ruby VM performance shootout here:</p>
<p><a href="http://www.oreillynet.com/ruby/blog/2007/02/fascinating_ruby_implementatio.html">http://www.oreillynet.com/ruby/blog/2007/02/fascinating_ruby_implementatio.html</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/maulanaruby.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/maulanaruby.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=13&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2007/08/01/rubinus-smalltalk-inspired-ruby-vm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>STI vs. Polymorphic association</title>
		<link>http://maulanaruby.wordpress.com/2007/02/17/sti-vs-polymorphic-association/</link>
		<comments>http://maulanaruby.wordpress.com/2007/02/17/sti-vs-polymorphic-association/#comments</comments>
		<pubDate>Sat, 17 Feb 2007 08:51:22 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby on rails]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/2007/02/17/sti-vs-polymorphic-association/</guid>
		<description><![CDATA[This is a common to have join between two tables based on condition. suppose we have table in database called comments and we can have comments on different thing like a video, profile or picture. So keeping DRY (Don&#8217;t repeat yourself) principle in mind while designing your database. You may want to have relationship between [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=5&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a common to have join between two tables based on condition. suppose we have table in database called comments and we can have comments on different thing like a video, profile or picture. So keeping DRY (<em>Don&#8217;t repeat yourself</em>) principle in mind while designing your database. You may want to have relationship between single comments table and videos or profiles table.</p>
<p>At database level you should have two fields in table one field (<em>i.e. type</em>)  that identifies the type of comment whether it is a comment on video or it&#8217;s a comment on profile, and another field (<span style="font-style:italic;">i.e source_id</span>) that contains id of the video or profile that comment was on.</p>
<p>In Ruby on Rails currently there are two ways to define this kind of association between your activerecord models:</p>
<p><strong>Single Table Inheritance:</strong></p>
<p>Here you &#8216;ll create a single table of comments and Comment AR class, there would be two additional classes ProfileComment and VideoComment inheriting from same Comment AR class. Instead of having association between Profile and Comment model there would be association between Profile and ProfileComment subclass. Same will be the case with Video model and VideoComment subclass.</p>
<p>If we take a look at comment table we &#8216;ll see that class name for each record will be automatically  stored in <em>type</em> field. The reference to associated table would be in <em>source_id </em>field.</p>
<p><code><br />
class Comment &lt; ActiveRecord::Base<br />
end<br />
class VideoComment &lt; Comment<br />
belongs_to :video, :foreign_key =&gt; "source_id"<br />
end<br />
class ProfileComment &lt; Comment<br />
belongs_to :profile, :foreign_key =&gt; "source_id"<br />
end<br />
</code><br />
<strong>Polymorphic Association</strong>:</p>
<p>Since Rails 1.1 there is a simpler way to create this kind of relationship called polymorphic association. In case of polymorphic association you &#8216;ll have two fields called <em>commentable_type</em> and <em>commentable_id, </em>instead of <em>type</em> and <em>source_id.  </em>The <em>commentable_type</em> field will store name of class which that instance relates to and <em>commentable_id</em> saves the reference to instance of that class. The relations will be created like this:</p>
<p><code><br />
class Comment &lt; ActiveRecord::Base<br />
    belongs_to :commentable, :polymorphic =&gt; true<br />
end<br />
class Video &lt; ActiveRecord::Base<br />
    has_many :comments, :as =&gt;  :commentable<br />
end<br />
class Profile &lt; ActiveRecord::Base<br />
    has_many :comments, :as =&gt;  :commentable<br />
end<br />
</code></p>
<p><strong>Pros and Cons:</strong></p>
<ul>
<li>The STI approach offers more flexibilty by allowing you to have additional fields that only have value in case of one sub class. For access from other sub class can be disallowed be overridden accessors.</li>
<li>The STI requires you to create a seperate class to implement a relation between two models, resulting in more classses. which is not case with polymorphic association</li>
<li>The STI results in more code.It  is confusing to some programmers to understand relation between STI classes</li>
<li> The polymorphic association is very easy to implement.</li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/maulanaruby.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/maulanaruby.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=5&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2007/02/17/sti-vs-polymorphic-association/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
		<item>
		<title>Migrate command in Rails 1.2</title>
		<link>http://maulanaruby.wordpress.com/2007/02/09/migrate-command-in-rails-12/</link>
		<comments>http://maulanaruby.wordpress.com/2007/02/09/migrate-command-in-rails-12/#comments</comments>
		<pubDate>Fri, 09 Feb 2007 20:14:39 +0000</pubDate>
		<dc:creator>hasham2006</dc:creator>
				<category><![CDATA[Ruby Language]]></category>
		<category><![CDATA[Ruby on rails]]></category>

		<guid isPermaLink="false">http://maulanaruby.wordpress.com/2007/02/09/migrate-command-in-rails-12/</guid>
		<description><![CDATA[The usual migrate command syntax of rake migrate VERSION=x throws a warning informing the user that the command is deprecated, the new command syntax is  rake db:migrate  look at other depreciations in rails 1.2 at http://www.railtie.net/articles/2006/11/02/deprecations-in-rails-1-2<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=4&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The usual migrate command syntax of</p>
<p><em>rake migrate VERSION=x</em></p>
<p>throws a warning informing the user that the command is deprecated, the new command syntax is</p>
<p><em> rake db:migrate </em></p>
<p>look at other depreciations in rails 1.2 at</p>
<p><a href="http://www.railtie.net/articles/2006/11/02/deprecations-in-rails-1-2">http://www.railtie.net/articles/2006/11/02/deprecations-in-rails-1-2</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/maulanaruby.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/maulanaruby.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/maulanaruby.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/maulanaruby.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/maulanaruby.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/maulanaruby.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/maulanaruby.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/maulanaruby.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/maulanaruby.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/maulanaruby.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/maulanaruby.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/maulanaruby.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/maulanaruby.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/maulanaruby.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/maulanaruby.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/maulanaruby.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=maulanaruby.wordpress.com&amp;blog=765503&amp;post=4&amp;subd=maulanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://maulanaruby.wordpress.com/2007/02/09/migrate-command-in-rails-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d08d5db582f1422f7a680693b504a356?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hasham2006</media:title>
		</media:content>
	</item>
	</channel>
</rss>
