Joe Moore's blog



Joe MooreJoe Moore
Standup 11/21/2008: Pro Bono Airwaves
edit Posted by Joe Moore on Saturday November 22, 2008 at 12:07AM

Interesting Things

  • Rails reminder: flash[:notice] = "Good Job" will survive a redirect, while flash.now[:notice] = "Good Job" will not. In general, flash.now is used when you render a template without a redirect, such as when a form submit has validation errors.
  • Good Books: Several folks have recommended JavaScript: The Good Parts.
  • Pro bono: Would anyone like to help out KUSF for free? Their new website project has been stalled for a year.

Ask for Help

"How do you get Selenium to work with Firefox 3?"

If you know how, pull the jar files out of a later release and use those. Good luck!

Joe MooreJoe Moore
Standup 11/20/2008: Engine Yard ssh key changes
edit Posted by Joe Moore on Friday November 21, 2008 at 01:23AM

Interesting Things

  • Engine Yard has made some changes to their ssh-key setup:

    ...any non-approved keys will be removed from the root user's authorized_keys file. It should be noted that customers should not log in directly as root but rather should log in as their user and use sudo for any commands that need super user privilege. If you are currently using the root user to log in and have your key in roots authorized_keys file it will be removed when this change is made.

    If you are having any ssh problems, contact them.

Joe MooreJoe Moore
Standup 11/19/2008: Team Strength, Fixtures, and Pivot Pong
edit Posted by Joe Moore on Thursday November 20, 2008 at 01:36AM

Interesting Things

  • Pivotal Tracker tip: as the Holiday Season approaches, you can edit your Team Strength to account for vacationing team members. For example, if you are missing 1 out of a team of 4 next week, set next week's Team Strength to 75%

    Pivotal Tracker team strength

  • Rescuing inside a transaction: ActiveRecord relies on catching a Rollback error in order to perform transaction rollbacks. If you are performing a begin..rescue block within a transaction, make sure you either (a) specify the Exception or Errors you want to catch, or (b) re-raise the Rollback error if caught.

  • Bring it! The Pivot Pong Tournament of Champions is on! Games will be played on the Pivotal breakfast tables/ping pong table.

    Pivot Pong table

Ask for Help

"What is the life-cycle of test fixtures when using transactional fixtures?"

  1. The testing framework clears the database of all data within tables that have fixtures files defined.
  2. A test/spec file is loaded and all fixtures declared within it (or all if fixtures :all is declared) are loaded into the database.
  3. A transaction is started.
  4. The test/spec runs.
  5. The transaction is rolled-back.
  6. Repeat!

Joe MooreJoe Moore
Standup 11/18/2008: Unbelievable has_many :through Gotcha
edit Posted by Joe Moore on Tuesday November 18, 2008 at 11:53PM
  • One team discovered a jaw-dropping issue with has_many :through. Given the following:

    class User < ActiveRecord::Base
      has_many :user_photos
      has_many :photos, :through => :user_photos
    
    • a_user.photos.create will create and persist both a Photo object and the UserPhoto join object
    • photo = a_user.photos.build followed by photo.save will create and persist the Photo object only, and will not persist an appropriate UserPhoto join object.
  • Rails 2.2: Test::Unit::TestCase extentions have been removed from Rails Core and are now in ActiveSupport::TestCase. As stated in the Groups Thread about this, use ActiveSupport::TestCase instead of Test::Unit::TestCase in test/test_helper.rb.

Joe MooreJoe Moore
Standup 11/17/2008: Google Chrome Gotchas
edit Posted by Joe Moore on Monday November 17, 2008 at 11:31PM

Interesting Things

Joe MooreJoe Moore
Pivotal Tracker Fluid Icon
edit Posted by Joe Moore on Thursday November 13, 2008 at 08:42PM

Here's a hot Fluid icon for Pivotal Tracker. Thanks, Ted!

sdfsdfsf

Check out a couple of other icons in this Flickr upload.

Joe MooreJoe Moore
Standup 11/07/2008: Selenium for Flash
edit Posted by Joe Moore on Friday November 07, 2008 at 05:23PM

Interesting Things

  • Teaser: Selenium for Flash! We've developed a Selenium-like framework for Flash. It's pre-alpha, and needs to be extracted from it's current home inside a project. Are you interested in a Selenium-like framework for Flash, or have you written one yourself? Let us know!
  • STI-weirdness. Rails surprise of the day: given a query of a has_many :photos where Photos has STI subclasses (got that?) Rails will build a SQL query that includes the subclass types of Photo, which you might not want:

    foo.photos.find_by_type("Photo") 
    # query will have "... WHERE type IN ('Photo', 'OriginalPhoto', 'ThumbnailPhoto')"
    
  • It appears that the retardase_inhibitor might not work with Rails 2.1.X due to fixes in ActionMailer.

  • JetBrains has been hard at work: they have released both a new Ruby plugin for IntelliJ, and a ruby-specific IDE (based on IntelliJ) named RubyMine.
  • Check out Pivot Jonathan's wife's art exhibit at Artist-Xchange Gallery in San Francisco, Friday 11/7 from 7-10pm:

    Artist-Xchange Gallery
    3169 16th Street
    San Francisco
    CA 94103

Ask for Help

"I want to create a custom launcher for Firefox 2 and Firefox 3 with different profiles. Perhaps the real question is how do we create a custom version of a Mac application launcher, passing in the arguments we need?"

... without having to invoke it on the command line every time.

"We're trying to delete cookies in our Controller, but they keep appearing in the headers anyway."

Suggestion: make sure you are specifying your URL paths and domains correctly.

"Why won't our CSS and other assets load the first time when accessing an SSL-protected domain on Engine Yard?"

It's most likely not Engine Yard or Firefox 3's fault. More research needed.

Joe MooreJoe Moore
Standup... and VOTE!
edit Posted by Joe Moore on Tuesday November 04, 2008 at 05:28PM

Interesting Things

  • It's election day! If you are taking the time to read this geeky blog, you better have voted!

Ask for Help

"Is there some order-dependency issue with `has_many_polymorphs?"

We have a test that passes in isolation, but fails when the whole file is run.

"Any advice to setting up Lucine to allow us to search for strings with special characters, such as '-', without having to wrap them in quotes?"

We have some Lucine knowledge here but feel free to give us your suggestions as well.