Joe Moore's blog
Standup 11/21/2008: Pro Bono Airwaves
Interesting Things
- Rails reminder:
flash[:notice] = "Good Job"will survive a redirect, whileflash.now[:notice] = "Good Job"will not. In general,flash.nowis 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!
Standup 11/18/2008: Unbelievable has_many :through Gotcha
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_photosa_user.photos.createwill create and persist both a Photo object and the UserPhoto join objectphoto = a_user.photos.buildfollowed byphoto.savewill create and persist the Photo object only, and will not persist an appropriate UserPhoto join object.
Rails 2.2:
Test::Unit::TestCaseextentions have been removed from Rails Core and are now inActiveSupport::TestCase. As stated in the Groups Thread about this, useActiveSupport::TestCaseinstead ofTest::Unit::TestCasein test/test_helper.rb.
Standup 11/07/2008: Selenium for Flash
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 :photoswhere 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:
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.
Standup 10/20/2008: Preventing Flash from Reloading
Interesting Things
- We discovered why a Flash widget was reloading itself: changes the CSS
positionvalue. We were hiding the Flash widget by moving it's containingdivoff the page withposition: absolute; left: -9000, and removing the class that had those values to show it again. It turns out that changing thatpositionvalue causes the Flash to reload. By keeping theposition:absolutesetting when we both show and hide our container div, the Flash no longer reloads.
Ask for Help
"When using Rails's date_select helper, is there a corresponding helper method to turn that date format into a Date object in the controller?"
Some Snippets are available, but how about a Rails built-in solution?
bookmark_fu: drop-in Iconistan
We just implemented bookmark_fu on Pivots and the experience was very smooth, taking only a few minutes. We how have an "Iconistan" of social bookmarking chiclets for either remembering or promoting content on Digg, reddit, del.icio.us -- almost 20 sites in all.

Install via the normal plugin install process (the -x installs it as an SVN:EXTERNAL):
#> ruby script/plugin install -x svn://rubyforge.org/var/svn/pivotalrb/bookmark_fu/trunk/bookmark_fu
I did have one issue -- the script/plugin install script pulled all the code down but ultimately failed because we have multiple versions of Rails on our development machine (about 5); this seemed to confuse the install script. No problem, though: I ran the install.rb script manually:
#> script/runner vendor/plugins/bookmark_fu/install.rb
Standup 02/16/2007
A shorty today.
Interesting Things
- A massive group of developers is revisiting and debating the current state of our shared-code architecture. appable_plugins might not be a perfect match, and we might develop our own or plugin-sharing system.
Total Stand-up Meeting Time: 12:00 minutes
Standup 02/15/2007
Interesting Things
- Subversion Tip: We were reminded of a handy tip: when saving shell scripts in subversion, you can save them as both executable and also in a 'native' end-of-line style, which will run on any platform.
<code> $> svn propset svn:executable ON somescript.sh $> svn propset svn:eol-style native somescript.sh </code>
- If you want some easy but very effective charts, check out WebFX's Chart Javascript library. Clients love them! Chart the number of users signed-up per day, etc.
- Another handy plugin we've used many times: QueryTrace. It helps you find slow database queries, but it really floods your logs with data, so make sure to turn it off in production!
- We're using appable_plugins for several projects but having problems with dependencies between the plugins, especially in fixtures. This might be caused by our fancy-dancy fixture loading extensions.
Ask for Help
- One project is doing another round of profiling and is looking at the the latest profiling tools for Ruby and Javascript. They are checking out Firebug's JS profiler,
ruby -r profile, and our own custom ruby test benchmarker, amongst others. - One project is seeing a very strange memory leak that causes 100MB of memory loss per second (guh! guh!). It started when they begin using
ActiveRecord.connection.execute("some sql")to build some reporting statistics, but it seems too early to blame that. Coincidental, though.
Brown Bag Lunch Topic: Rails 1.2 features, ideas, and gotchas.
Total Stand-up Meeting Time: 25:00 minutes
Interesting/Ask for Help for 02/14/2007
Interesting Things
- We'll be sending 6 people to RailsConf, so say 'hi' if you see the Pivots!
- We have a fix to our Amazon S3-causing-mongrel-to-hang problem: you can tell the connection not to be persistent by passing in
:persistent => false:
<code>
AWS::S3::Base.establish_connection!(
:access_key_id => access_key,
:secret_access_key => access_key,
:persistent => false
)
</code>
Ask for Help
- From the community: the JRuby team is putting out a cry for help for everyone to get JRuby running Rails 100%.
Total Stand-up Meeting Time: 14:00 minutes








