Kelly Felkins's blog
Standup 7/28/2008
Interesting
- firebug lite 1.2 is out
Ask for Help
We upgraded to rails 2.1 and polonium and our rspecs are not running on CI, but run fine if you simply use rake on the command line.
Check to see if you are using the rake extensions in pivotal core bundle.
Using setTimeout() to wait for DOM to update in JsUnit does not work.
Using setTimeout in tests is not going to do what you want, unless you mock setTimeout. Basically, setTimeout kicks off another thread which is not likely to effect the current test.
Standup 7/24/2008
Interesting

- There was war story told involving software that's not generally available. However, one tidbit that may be of general interest is a reminder that you don't necessarily get a perfect copy of your mysql database when restoring from a dump of that database. Mysqldump by default writes the data of each table preceded by a
DROP TABLE IF EXISTSand aCREATE TABLEstatement. This covers you in most situations, but misses when new tables have been created since the dump was made -- those new tables are not deleted. They may not cause problems, but some systems are sensitive to the existence of those tables, such as rails and theschema_infoandschema_migrationstables.
Ask for Help
- question: Is merb hosting different from rails hosting?
- answer: no
Standup 5/9/2008
Interesting
- attr_readonly marks an attribute as, ah, read only -- use it to tell ActiveRecord that an attribute should not be a part of update operations. Rails uses attr_readonly internally with counter caches (search for "counter_cache" under ActiveRecord::Associations::ClassMethods) since counter caches are incremented/decremented directly in the database with sql. Without attr_readonly, subsequent updates of the counter_cache'd model would revert the counter to the value of the counter at the time the model was loaded.
Note: attr_readonly was either buggy or not exposed prior to 1.2.3. If you are using a version of rails prior to 1.2.3 you can do this instead:
def attributes_with_quotes(include_primary_key = true)
attributes.inject({}) do |quoted, (name, value)|
if column = column_for_attribute(name)
# original:
# quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary
quoted[name] = quote_value(value, column) unless !include_primary_key &&
(column.primary || ["your_attributes", "listed_here"].include?(column.name))
end
quoted
end
end
Ask for Help
- help: Looking for recommendations on converting an existing schema to a new schema. We are considering dumping the existing schema to yaml (using ar_fixtures) and making the transformations there.
- answer #1: One recent project had a "liberate" script that extracted information from the legacy database via sql statements and constructed AR model objects as necessary. The liberate script grew to some 1500 lines of code and was refactored many times.
- answer #2: Another project did the data migration by first importing the legacy database and then using rails migrations as needed to transform the data to the new schema. Most of the migrations used sql for the transformations. These migrations did not have associated unit tests.
- Please offer your suggestions in the comments.
Standup 5/8/2008
Interesting
- Firebug 1.2 Alpha works with Firefox 3 Beta nightly builds
- Firefox 2 and Firefox 3 can peacefully coexist on the same system with different profiles
Ask for Help
- help: "JsUnit doesn't work with Firefox 3"
- answer #1: Apparently not with the file based url, but does work with the http url
- answer #2: "There appears to be what some consider a bug in Firefox 3 in which JS access across frames has changed from Firefox 2..." (Follow that link for an interim fix starting at "Here's the good news:")
Standup 5/7/2008
Interesting
- "JsUnit has been updated" A new feature available on trunk is a "modern" ui. The modern ui has 2 panes, with errors and failures listed on the left. Clicking on an error displays details on the right. Get this by 1) installing trunk, and 2) specifying "ui=modern" as a parameter.

Ask for Help
- help: "Selecting an iframe with Selenium RC fu" It appears that selenium has the ability to select an iframe, but it doesn't work in selenium rc fu.
- answer: Apparently the selenium provided in selenium rc fu is an older version
Standup 5/6/2008
Ask for Help
- "RSpec only Hoe?" How do you convince Hoe to only run specs and not tests?
- In the distance a dog barks...
- "Is there a fun way to learn Ruby?" I have a 500 page book, but is there a fun way to learn Ruby?
- (various pivots look at each other) "Pairing...of course"
- "Use RSpec to verify deployment?" Previously I used Rspec with JRuby to create stories for a java project. It would be nice to have a deployment story. The plan would say "apache goes here", "mongrel goes there", "mysql goes over there". You could show the plan to your customer printed on a piece of paper and you could run it to do the deployment.
- Capistrano can provide some of this vision.
Standup 05/05/2008
Interesting Things
- Interesting things were all about internal Pivotal Labs activities this week.
Ask for Help
Window.frames['name']If we add a frame, then remove it, then add it again, it's still there.- [silence]
"What's that gem that draws a graph of your models?"








