Joe MooreJoe Moore
Standup 03/12/2007
edit Posted by Joe Moore on Monday March 12, 2007 at 03:36PM

Interesting Things

Total Stand-up Meeting Time: 10:00 minutes

Joe MooreJoe Moore
Standup 03/09/2007
edit Posted by Joe Moore on Friday March 09, 2007 at 03:34PM

Just project updates today!

Total Stand-up Meeting Time: 13:00 minutes

Joe MooreJoe Moore
Standup 03/08/2007
edit Posted by Joe Moore on Thursday March 08, 2007 at 12:27AM

Interesting Things

  • We created a complete Ruby on Rails setup script for Mac OS X. Give it a try if you are bootstrapping a Mac for Rails.
  • If you are having problems with Hpricot, update your gem to 0.5, which has improvements.

Ask for Help

  • One project is looking for menu system suggestions, so feel free to mention your favorites.
  • We had quite a conversation about saving URLs in model objects. For example, what if you have an internal mail/message system on a site, and you want the system to embed links such as "click here to view the sender's profile." As the system is refactored, the target of those links might change and we'd prefer not to have to search for URLs in the database and change them. As we implement a solution perhaps we'll post it here.

Total Stand-up Meeting Time: 13:00 minutes

Joe MooreJoe Moore
Standup 03/07/2007
edit Posted by Joe Moore on Wednesday March 07, 2007 at 03:11PM

Interesting Things

  • Watch out for this This Rails bug: find :conditions => 'id is null' returns a record with a non-null id
  • We experimented with using the :after CSS float-clearing method after reading this Contained Float article. Though interesting, its seems very fragile, especially for IE.
  • It looks like the Rspec problem with Controller tests is a combination of Rails 1.2 and out own custom code.
  • We're going to try out CruiseControl.rb on an internal project. We'll keep you posted.

Total Stand-up Meeting Time: 18:00 minutes

Joe MooreJoe Moore
Standup 03/06/2007
edit Posted by Joe Moore on Tuesday March 06, 2007 at 09:09PM

Interesting Things

  • The Rspec version 8.2 does not work well with appable_plugins: When running Controller Specs from within an appable_plugin, those plugin's test fixtures will not load.
  • We've created some Rake tasks to run all appable_plugin tests in one go. Nice!
  • We've moved to a bigger, faster SVN server, so checkouts and updates should be faster.
  • Following up on earlier events, we've successfully completed migrating one client's codebase out of our SVN server and into their repository. Good job folks!
  • Remember to use filter_parameter_logging in Rails, which prevents Rails from outputting the parameters you specify to any log files.
  • Bidirectional polymorphic join tables and has_many_polymorphs: always best described as art!

"bidirectional has many polymorphs"

Ask for Help

  • Does anyone know how to exclude the 'log' directory from searches in the new IntelliJ IDEA Ruby Plugin?. The Java plugin allows for this.
    • UPDATE: Here's how: in your project.iml file, add excludeFolder tags inside your content tag.
<code>
     &lt;content url="file://$MODULE_DIR$">
       &lt;excludeFolder url="file://$MODULE_DIR$/components" />
       &lt;excludeFolder url="file://$MODULE_DIR$/log" /> 
       &lt;excludeFolder url="file://$MODULE_DIR$/tmp" />
     &lt;/content>
</code>

Total Stand-up Meeting Time: 17:00 minutes

Joe MooreJoe Moore
Standup 03/05/2007
edit Posted by Joe Moore on Tuesday March 06, 2007 at 04:41PM

Interesting Things

  • Rake tasks in Rails eat many errors, causing just about any error (including syntax errors) to to fail "silently": instead of displaying the real error, Rake will tell you that your task is missing. Not nice.

Total Stand-up Meeting Time: 9:00 minutes

Joe MooreJoe Moore
Standup 03/02/2007
edit Posted by Joe Moore on Saturday March 03, 2007 at 02:15PM

Interesting Things

  • rals_spec_server is a Rspec test running server that does not incur the test-framework startup time tax once it is running in memory. Preliminary (unscientific) results show that individual 'specs run 20-30% faster. But, you have to set config.cache_classes = false in test.rb for the server to reload everything and pick up any changes you've made.

Ask for Help

  • Now that we are nearly finished successfully transitioning control of a client's project to their developers, we want to use SVK to export a client's code our of our SVN repository into their repo. We've never used SVK, so experience reports would be welcomed.

Total Stand-up Meeting Time: 13:00 minutes

Alex ChaffeeAlex Chaffee
Standup 3/1/07
edit Posted by Alex Chaffee on Friday March 02, 2007 at 05:58AM

We're experimenting with running our Capistrano deploy onto a Mac Mini. Note that this is Capistrano running Net::SSH running ssh protocol and spawing a remote shell in which we execute commands. Unfortunately, the remote process can't find the svn binary. Even though running echo $SHELL returns /bin/bash, it's not executing any of the startup scripts we know about (~/.bashrc, ~/.bash_profile, /etc/environment, /etc/profile, etc.), and the PATH is remaining the boring standard one (/usr/bin:/bin:/usr/sbin:/sbin). Damon says there's a setting inside the sshd config that might help...

UPDATE: this was solved by setting

PermitUserEnvironment yes

in /etc/sshd_config, and then setting

PATH=/bin:/sbin:/user/sbin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/user/local/mysql-standard-5.0.24-osx10.4-i686/bin

in ~/.ssh/environment


Apparently the Rails rules for pluralizing controller names has changed. Recently the tendency seems to be to use plural names for RESTful controllers (e.g. GET /projects/42) rather than singular names for traditional controllers (/project/show/42). Is this intentional? Is it a new convention, or a change to the old one, or a violation?


We're having a Brown Bag today on Ruby Foo, covering many strange and wonderful topics, including class methods, singleton classes, lexical scoping, and the lambda calculus. And why the sea is boiling hot, and whether pigs have wings.


Words of wisdom: when you're modeling currency, don't use floats. This is a bad idea in the long run since floats might store $2.50 as 2.50000001. See Coda Hale's dollars_and_cents plugin. Ian adds: "Database tables for currency should be of type decimal. (e.g. amount DECIMAL(10,2)) This turns into a BigDecimal in your AR object, which is a bit of a pain, since it doesn't act exactly like a regular number. We talked about mixing in some methods into BigDecimal, to make it behave more like a regular numeric type. It feels weird coming from a Java background, and normal coming from a Smalltalk background. I'm curious what people's thoughts are on it."


Today is the Group Hug for our latest release of Tracker. Get ready to try to kill Tracker with love!


We like RSpec, and are ready to upgrade to the new version. There's a new style for the DSL; the old and new dialects will live side-by-side for a while but we should convert to use the new one soon.


Daylight Saving Time is coming up, and already it's causing some of our tests to fail: we had code that calculated the number of days between two dates. Turns out the implementation assumed that every day has 24 hours in it. Not so! March 11, for instance, will have 23 hours, and November 4 will have 25. That's in the US; see here for other countries.


Other articles: