<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-21848291</id><updated>2011-06-08T12:25:56.913+05:30</updated><title type='text'>RubyWorks</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>karthik c</name><uri>http://www.blogger.com/profile/10681914924722584656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/174/464853051_907609dc65.jpg?v=0'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-21848291.post-114976428572722221</id><published>2006-06-08T16:26:00.000+05:30</published><updated>2006-06-08T16:28:05.740+05:30</updated><title type='text'>faster tests</title><content type='html'>If you are using sqlite, &lt;a href="http://nubyonrails.topfunky.com/articles/2006/06/01/san-francisco-sqlite3-memory-tests-asteroids"&gt;this plugin&lt;/a&gt; is a nice way to speed up your tests&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114976428572722221?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114976428572722221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114976428572722221' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114976428572722221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114976428572722221'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/06/faster-tests.html' title='faster tests'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114830084398367582</id><published>2006-05-22T17:40:00.000+05:30</published><updated>2006-05-22T17:57:24.006+05:30</updated><title type='text'>assertions when using rjs</title><content type='html'>&lt;a href="http://www.rubynoob.com/articles/2006/05/13/simple-rails-rjs-tutorial"&gt;rjs&lt;/a&gt; is a pretty neat way to avoid javascript code and implement the required functionality using ruby/rails itself.&lt;br /&gt;&lt;br /&gt;When &lt;a href="http://www.rubyonrails.org/"&gt;rails&lt;/a&gt; comes across a rjs template, it renders the html page and inserts the JavaScript into that page and returns it to the browser for execution.&lt;br /&gt;&lt;br /&gt;Which is good, until you figure out that the functional testing assertion framework that ships with Rails suddenly does not hold good ! Basically the asserts work on the assumption that after an action is performed, the response object holds valid HTML code which it can hook into and perform the assertions, whereas when we use rjs the respose body actually contains Javascript code too.&lt;br /&gt;&lt;br /&gt;Came across this &lt;a href="http://ibrasten.com/articles/2006/04/05/rjs-assertions"&gt;nice assertions plugin(rjs_assertions)&lt;/a&gt; which helped us test the code which had the rjs bits. Good stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114830084398367582?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114830084398367582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114830084398367582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114830084398367582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114830084398367582'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/05/assertions-when-using-rjs.html' title='assertions when using rjs'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114551259402153698</id><published>2006-04-20T11:20:00.000+05:30</published><updated>2006-04-20T11:26:34.036+05:30</updated><title type='text'>Creating a Synchronous call using Prototype</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;Tried to make a Synchronous Ajax call using the &lt;a href="http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request"&gt;Script.aculo.us Library&lt;/a&gt;. Damn how do you do it ?&lt;/span&gt;  &lt;pre style="font-family: trebuchet ms;"&gt;&lt;code&gt;new Ajax.Request('/foo/bar', {asynchronous:true});&lt;/code&gt;&lt;/pre&gt; &lt;span style="font-family:trebuchet ms;"&gt;Looking at the code, setting the &lt;span style="font-weight: bold;"&gt;'asynchronous'&lt;/span&gt; flag to &lt;span style="font-weight: bold;"&gt;'false'&lt;/span&gt; should do the trick. Unfortunately, this does not seem to work.&lt;/span&gt; &lt;pre style="font-family: trebuchet ms;"&gt;&lt;code&gt;&lt;br /&gt;new Ajax.Request('/foo/bar', {asynchronous:false});&lt;/code&gt;&lt;/pre&gt; &lt;span style="font-family:trebuchet ms;"&gt;Wierd&lt;br /&gt;&lt;br /&gt;But got a chance to peek into &lt;a href="http://prototype.conio.net/"&gt;prototype.js&lt;/a&gt;. Wow. Javascript can be beautiful. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114551259402153698?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114551259402153698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114551259402153698' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114551259402153698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114551259402153698'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/04/creating-synchronous-call-using.html' title='Creating a Synchronous call using Prototype'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114518642078949764</id><published>2006-04-16T14:28:00.000+05:30</published><updated>2006-04-16T17:53:04.650+05:30</updated><title type='text'>App Wide settings</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;We recently played a card which read something along these lines - '&lt;/span&gt;&lt;span style="font-style: italic;font-family:trebuchet ms;" &gt;As a user of this system I should be able to set some application settings in the database&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Till date we had kept all the 'settings' (for the lack of a better word) in a module and we were using it off the module.&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: trebuchet ms;"&gt;module Prefs&lt;br /&gt; BASE_DIR='blah'&lt;br /&gt; REMOTE_SERVER='blah blah'&lt;br /&gt; ...&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:trebuchet ms;"&gt;usage in the code  was   &lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: trebuchet ms;"&gt;  Prefs::BASE_DIR&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:trebuchet ms;"&gt;Had not heard about this &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://beautifulpixel.textdriven.com/articles/2006/03/03/settings-plugin-updated"&gt;Settings plugin by Alex Wayne&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;,  but I think we came up with a simpler solution using the '&lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.iunknown.com/articles/2005/11/09/fun-with-const_missing-and-method_missing"&gt;const_missing&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;' on an object. The Settings plugin uses 'method_missing' to do pretty much the same, but it needed constants to be called like this - Prefs.constant(which I feel is confusing) rather than Prefs::CONSTANT.&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: trebuchet ms;"&gt;module Prefs&lt;br /&gt; def self.const_missing(constant)&lt;br /&gt;   const_set(constant, Preference.value(constant))&lt;br /&gt; end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:trebuchet ms;"&gt;So basically whenever we access a constant on Prefs (like Prefs::BASE_DIR) the const_missing is triggered and we dip into the Preference table to fetch the constant and set it on Prefs.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;So a bunch of hardcoded constants were easily turned into a few lines of code that fetched the information from the database. And the best part was that we did not have to go and change the way we access constants all over the code.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114518642078949764?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114518642078949764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114518642078949764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114518642078949764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114518642078949764'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/04/app-wide-settings.html' title='App Wide settings'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114443080273802635</id><published>2006-04-07T22:54:00.000+05:30</published><updated>2006-04-07T22:57:40.006+05:30</updated><title type='text'>What ?</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;just came across this today !&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: trebuchet ms;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/5796/120/1600/deprecated.jpg"&gt;&lt;img style="cursor: pointer; width: 408px; height: 31px;" src="http://photos1.blogger.com/blogger/5796/120/320/deprecated.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Looks like &lt;span style="font-weight: bold;"&gt;&lt;some&gt;.id&lt;/some&gt;&lt;/span&gt; is going to be deprecated soon and we're going to be heading the &lt;span style="font-weight: bold;"&gt;&lt;some&gt;.object_id&lt;/some&gt;&lt;/span&gt; soon !&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114443080273802635?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114443080273802635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114443080273802635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114443080273802635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114443080273802635'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/04/what.html' title='What ?'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114371872094053375</id><published>2006-03-30T17:06:00.000+05:30</published><updated>2006-03-30T17:08:40.950+05:30</updated><title type='text'>create YAML Fixtures</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Very cool.&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: verdana;" href="http://nubyonrails.com/articles/2005/12/27/dump-or-slurp-yaml-reference-data"&gt;This&lt;/a&gt;&lt;span style="font-family: verdana;"&gt; makes it very simple to convert your data into YAML fixtures to be used in tests.&lt;/span&gt;&lt;span class="down" style="display: block; font-family: verdana;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114371872094053375?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114371872094053375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114371872094053375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114371872094053375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114371872094053375'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/create-yaml-fixtures.html' title='create YAML Fixtures'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114327254662432858</id><published>2006-03-25T13:02:00.000+05:30</published><updated>2006-03-25T13:17:55.330+05:30</updated><title type='text'>Test Databases - do a rake migrate if you change the structure</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;Some of the functional tests were failing because of a missing column in a table. Took us some time to figure out the real issue.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Added an extra column 'x' using &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://wiki.rubyonrails.org/rails/pages/ActiveRecordMigration"&gt;rails migration&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;. Ran the functional tests to make sure that they all pass. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;They failed, complaining that there was no column 'x' present.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Decided to check the test_database to see if that new column was created in the table. And it was not. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;The way rails handles testing, it creates a test_database using the structure of the tables in the development_database and populates the tables using the fixtures. Hence if the development_database is not current (w.r.t the migration scripts) then the test database too does not have the latest structure.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Ran the migrate task. Got the development_database synched up and ran the tests.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Voila. All passed :-)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114327254662432858?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114327254662432858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114327254662432858' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114327254662432858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114327254662432858'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/test-databases-do-rake-migrate-if-you.html' title='Test Databases - do a rake migrate if you change the structure'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114296195602253228</id><published>2006-03-21T22:45:00.000+05:30</published><updated>2006-03-21T22:55:56.040+05:30</updated><title type='text'>Puzzling behavior</title><content type='html'>Was debugging some code today that was working on a windows box, but was not working in a Linux box.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class MapController&lt;br /&gt; model :Roads&lt;br /&gt;&lt;br /&gt; def draw_roads&lt;br /&gt;   render :text =&gt; "No Routes to show" if no_roads&lt;br /&gt; end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;On the linux box, draw_roads would always look for a draw_roads.rhtml template and go ahead with the execution. Whereas in a Windows box, the check would be performed and accordingly a render of "No Routes to Show" would happen or draw_roads.rhtml would have gotten rendered.&lt;br /&gt;&lt;br /&gt;After some debugging and placing of puts statements in the code figured that the issue was with the&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; model :Roads&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;bit. It should have been&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; model :roads&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But still not sure why this worked on a windows box and not a linux box !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114296195602253228?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114296195602253228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114296195602253228' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114296195602253228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114296195602253228'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/puzzling-behavior.html' title='Puzzling behavior'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114296128012869839</id><published>2006-03-21T22:44:00.000+05:30</published><updated>2006-03-21T22:44:40.146+05:30</updated><title type='text'>Javascript development</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;Stumbled upon an interesting Plugin for Eclipse today. &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.interaktonline.com/Products/Eclipse/JSEclipse/Overview/"&gt;JSEclipse&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;. Very useful when you dabble a bit in Javascript at work and during play &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114296128012869839?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114296128012869839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114296128012869839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114296128012869839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114296128012869839'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/javascript-development.html' title='Javascript development'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114270569178971839</id><published>2006-03-18T23:38:00.000+05:30</published><updated>2006-03-18T23:44:51.800+05:30</updated><title type='text'>Ruby Hacking Guide</title><content type='html'>Awesome News.&lt;br /&gt;&lt;br /&gt;Vincent has started translating the &lt;a href="http://rhg.rubyforge.org/"&gt;Ruby Hacking Guide&lt;/a&gt; into English !!&lt;br /&gt;Currently only one chapter has been translated. And its awesome. The original book is in Japanese. Had tried converting it into English using Google Translate, but things did not make too much sense.&lt;br /&gt;&lt;br /&gt;After reading the chapter on &lt;a href="http://rhg.rubyforge.org/chapter02.html"&gt;Objects&lt;/a&gt; in the translated version, lotsa small things started falling into place. Like for example I finally understood why we have symbols in Ruby.&lt;br /&gt;&lt;br /&gt;Great going Vincent.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114270569178971839?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114270569178971839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114270569178971839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114270569178971839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114270569178971839'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/ruby-hacking-guide.html' title='Ruby Hacking Guide'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114173909696121314</id><published>2006-03-07T19:01:00.000+05:30</published><updated>2006-03-07T21:11:20.750+05:30</updated><title type='text'>require 'pain_in_the_ass'</title><content type='html'>&lt;span style="font-style: italic;"&gt;disclaimer: I might be doing something wrong, hence the experience.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Using Stubs in Rails has been one hell-of-an-experience.&lt;br /&gt;The concept of using mocks/stubs in Rails is very simple (just open a class and add stuff to it). But in practise, this has never been the experience. Whenever I have tried to use mocks, trying to require the original file has been very painful.&lt;br /&gt;&lt;br /&gt;For example I have this file called &lt;span style="font-weight: bold;"&gt;song_search.rb&lt;/span&gt; under &lt;span style="font-weight: bold;"&gt;app/controllers&lt;/span&gt;&lt;br /&gt;Tried writing a mock under &lt;span style="font-weight: bold;"&gt;/test/mock&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; require File.dirname(__FILE__) + '/../../../app/controllers/song_search'&lt;br /&gt;   class SongSearch&lt;br /&gt;  def page&lt;br /&gt;      end&lt;br /&gt; end&lt;br /&gt;&lt;br /&gt;But the tests indicated that this file was not being picked up !! Tried all combinations to get the require right. To no avail. Im sure Im doing something wrong. It cant be that difficult.&lt;br /&gt;&lt;br /&gt;Anyways in the end, I just added this to the test class&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;require 'song_search'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    class SongSearch; def page() @page end; end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That worked. But gotto find a better way to do this. :-(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114173909696121314?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114173909696121314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114173909696121314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114173909696121314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114173909696121314'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/require-painintheass.html' title='require &apos;pain_in_the_ass&apos;'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114170514019450027</id><published>2006-03-07T09:34:00.000+05:30</published><updated>2006-03-07T09:49:00.203+05:30</updated><title type='text'>sqlite3 database meta information</title><content type='html'>&lt;span style="font-family: times new roman;font-size:85%;" &gt;&lt;span style="font-family: verdana;"&gt;After being pretty unsuccesful trying to read the docs for sqlite3 table metadata, last evening we managed to pull these sql statements out of the rails sqlite3 adatapter code:&lt;br /&gt;&lt;br /&gt;       PRAGMA table_info(&lt;span style="font-style: italic;"&gt;table_name&lt;/span&gt;)&lt;br /&gt;        SELECT name FROM sqlite_master WHERE type = 'table'&lt;br /&gt;        PRAGMA index_list(&lt;span style="font-style: italic;"&gt;table_name&lt;/span&gt;)&lt;br /&gt;        PRAGMA index_info('&lt;span style="font-style: italic;"&gt;index_name&lt;/span&gt;')&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: times new roman;font-size:85%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114170514019450027?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114170514019450027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114170514019450027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114170514019450027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114170514019450027'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/sqlite3-database-meta-information.html' title='sqlite3 database meta information'/><author><name>karthik c</name><uri>http://www.blogger.com/profile/10681914924722584656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm1.static.flickr.com/174/464853051_907609dc65.jpg?v=0'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114124582685776973</id><published>2006-03-02T02:07:00.000+05:30</published><updated>2006-03-02T02:13:46.876+05:30</updated><title type='text'>Faster testing with Rails</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Just came across this article &lt;a href="http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting"&gt;Faster testing with Rails 1.0&lt;/a&gt; by Mike Clark&lt;br /&gt;Decided to check out the impact of it on our application.&lt;br /&gt;&lt;br /&gt;Currently we are using both transactional_fixtures as well as instantiated_fixtures.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;UnitTests  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Finished in 2.197282 seconds.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;48 tests, 247 assertions, 0 failures, 0 errors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Functional Tests&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Finished in 3.798338 seconds.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;56 tests, 226 assertions, 0 failures, 0 errors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;on turning off instantiated_fixtures (&lt;span style="font-style: italic;"&gt;as suggested by Mike&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;UnitTests &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Finished in 1.999902 seconds.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;48 tests, 247 assertions, 0 failures, 0 errors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Functional Tests &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Finished in 3.59077 seconds.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;56 tests, 226 assertions, 0 failures, 0 errors&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Not too much of a difference. But then we still dont have too many tests and I guess every second counts.&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114124582685776973?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114124582685776973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114124582685776973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114124582685776973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114124582685776973'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/faster-testing-with-rails.html' title='Faster testing with Rails'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114124044406247969</id><published>2006-03-02T00:40:00.000+05:30</published><updated>2006-03-02T00:44:04.070+05:30</updated><title type='text'>Extension vs Mixin</title><content type='html'>&lt;a href="http://lunchroom.lunchboxsoftware.com/articles/2005/08/29/extension-vs-mixing-in"&gt;Rocking post&lt;/a&gt; at &lt;a href="http://lunchroom.lunchboxsoftware.com"&gt;The LunchRoom&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114124044406247969?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114124044406247969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114124044406247969' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114124044406247969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114124044406247969'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/03/extension-vs-mixin.html' title='Extension vs Mixin'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114114355050029162</id><published>2006-02-28T21:31:00.000+05:30</published><updated>2006-03-06T21:06:26.020+05:30</updated><title type='text'>Performance Issues - With produces</title><content type='html'>We seem to be having an issue with the periodical on this project.&lt;br /&gt;&lt;br /&gt;There is a small portion of the application which needs to be updated whenever a user interacts with a hardware device connected to the machine.&lt;br /&gt;&lt;br /&gt;Our initial take on this was to have a periodical which would poll the server every '0.5' seconds to figure out if the event had happened. Very simple indeed.&lt;br /&gt;&lt;br /&gt;Until we were hit with some insane performance issues !!&lt;br /&gt;&lt;br /&gt;Initially we saw that all the development machines, but one, seemed to be hogging more and more memory as time passed by, and eventually some of them just froze up. After some poking around the only difference we could see was that on that 'one' machine we had ruby compiled for the i386 whereas all the others seem to be i686 (thats what ruby -version told us). So we went ahead and installed the precompiled i386 version of ruby on some machines and that seemed to solve the issue for sometime (still dont understand why)&lt;br /&gt;&lt;br /&gt;Anyways. The issue resurfaced and today we went about trying to fix it.&lt;br /&gt;&lt;br /&gt;Initially we thought that instead of doing a Pull from the client we should &lt;a href="http://www.xulplanet.com/tutorials/mozsdk/serverpush.php"&gt;Push this information&lt;/a&gt; from the server. The basic idea behind a Push from the server being that once a connection is opened to the server by a client, the server keeps this connection open by never closing it and periodically (or whenever the need arises) sending information to the client.&lt;br /&gt;&lt;br /&gt;So spent a bit of time today reading up on how to push information from the server and trying to implement it with Rails. There are quite a few &lt;a href="http://ajaxpatterns.org/HTTP_Streaming#Realtime_on_Rails"&gt;interesting examples&lt;/a&gt; on how to do this. But we ended up digging into the Rails code to figure out how rendering actually works in rails and figured that it was not easy to bypass the rails way of doing things. Rails prevents us from doing this kind of stuff(keeping the connection open and rendering continuously) because of the Double Render issue. So we tried to get the response object and tried to work with the output stream on the response object. But dipping into the Rails code we figured that the output stream is just a StringIO and later the rails actually picks up the data and uses it to create the body and header and pushes this info to webrick.&lt;br /&gt;&lt;br /&gt;In the end found this &lt;a href="http://wiki.rubyonrails.org/rails/pages/ProductionEnvironments/versions/20"&gt;link&lt;/a&gt;. Basically it mentions that in the development mode the rails app reloads itself on every request.&lt;br /&gt;&lt;br /&gt;Daaam !! Had forgotten about this. So just tried to run the application in production mode and things seem to be fine now !!&lt;br /&gt;&lt;br /&gt;whew ...&lt;br /&gt;&lt;br /&gt;Found another Web server &lt;a href="http://mongrel.rubyforge.org/index.html"&gt;mongrel&lt;/a&gt;. This seems to be much faster than webrick. It consumed half the memory that Webrick was consuming and the app seemed snappier when using mongrel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114114355050029162?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114114355050029162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114114355050029162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114114355050029162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114114355050029162'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/02/performance-issues-with-produces.html' title='Performance Issues - With produces'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114114091749329703</id><published>2006-02-28T20:56:00.001+05:30</published><updated>2006-02-28T21:05:17.503+05:30</updated><title type='text'>Creating a production db in rails</title><content type='html'>To setup your database for production - &lt;br /&gt;1) Add an entry for production in the database.yml file&lt;br /&gt;2) Run "rake environment RAILS_ENV=production migrate"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114114091749329703?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114114091749329703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114114091749329703' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114114091749329703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114114091749329703'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/02/creating-production-db-in-rails.html' title='Creating a production db in rails'/><author><name>HARI</name><uri>http://www.blogger.com/profile/09049645221864383549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114079659206001807</id><published>2006-02-24T21:05:00.000+05:30</published><updated>2006-03-01T19:36:33.680+05:30</updated><title type='text'>Calling methods on another Controller in Functional Tests</title><content type='html'>Today while trying to write a functional test in our rails app we came across an issue wherein the session had to be setup in a particular manner before we could actually test this action we were interested in.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;post :delete_flower&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;so we wanted delete_flower action to be called on the FlowerController. But for the test to pass we needed some action on GardenController to be called (so as to mimic what would happen on the GUI)&lt;br /&gt;&lt;br /&gt;but get and post methods are called only on the current controller. So we wrote up this helper method in the test_helper.rb file&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Test::Unit::TestCase&lt;br /&gt; def switch_controller(klass)       &lt;br /&gt;  old_controller = @controller       &lt;br /&gt;  @controller = klass.new       &lt;br /&gt;  yield&lt;br /&gt;  @controller = old_controller&lt;br /&gt; end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So in our code we could do something like&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;def test_delete&lt;br /&gt; switch_controller(GardenController) do&lt;br /&gt;   post :plant_flower&lt;br /&gt; end&lt;br /&gt; post :delete_flower&lt;br /&gt; assert_no_flower_in_garden&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[Updated later] - Just saw that they have added the concept of an &lt;a href="http://weblog.rubyonrails.com/articles/2006/03/01/new-for-rails-1-1-integration-tests"&gt;Integration Test&lt;/a&gt; for the next release of rails.&lt;br /&gt;So Looks like all this might not be necessary !!&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114079659206001807?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114079659206001807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114079659206001807' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114079659206001807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114079659206001807'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/02/calling-methods-on-another-controller.html' title='Calling methods on another Controller in Functional Tests'/><author><name>ROhan</name><uri>http://www.blogger.com/profile/14326999360223511768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21848291.post-114053124807774944</id><published>2006-02-21T19:39:00.000+05:30</published><updated>2006-02-24T21:29:15.616+05:30</updated><title type='text'>Active Record, Observer and troubles</title><content type='html'>When you attach an observer to an ActiveRecord you normally would expect certain callbacks like after_update etc. to occur on appropriate events. But there could be workflows where this callback may not occur. Atleast thats what we found out today.&lt;br /&gt;We have a search box where the user can key in the name of a song and this causes all the songs matching the criteria to be loaded. We were trying to observe the Song object for updates to any of its fields.&lt;br /&gt;In the siprit of TDD we started by writing our tests first and within a few mins our test that asserted that the callback's occurrance was passing.&lt;br /&gt;Now we tried the same in the development environment  from the browser. And it did not work.&lt;br /&gt;After digging for sometime we saw that the only difference between the development and test envs was that class caching was turned on in the test env while it was not in the dev env. We turned on class caching in the dev env and it worked like a chum (config.cache_classes = true).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21848291-114053124807774944?l=rubyworks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyworks.blogspot.com/feeds/114053124807774944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21848291&amp;postID=114053124807774944' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114053124807774944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21848291/posts/default/114053124807774944'/><link rel='alternate' type='text/html' href='http://rubyworks.blogspot.com/2006/02/active-record-observer-and-troubles.html' title='Active Record, Observer and troubles'/><author><name>HARI</name><uri>http://www.blogger.com/profile/09049645221864383549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
