Joe Moore's blog



Standup 02/28/2007

edit Posted by Joe Moore on Wednesday February 28, 2007 at 04:36PM

Interesting Things

  • JSON: the consensus seems to be that ActiveRecord's to_json method is buggy, and that people wishing to transform their ActiveRecords into JSON should use the Fast JSON gem.
  • Here's a Rails gotcha: if you are performing a form POST from a Rails template, there is a risk that any query-parameters in your URL will "stomp" parameters with the same key in your form. In the following code example, id = 1 will be sent to your app:
<code>
    # id = 1 will be sent to the app below
    url: http://railsapp.com/person/play_with&id=1

    --- in play_with.rhtml: 
    # id = 9 will NOT be sent to the app
    # because of the `&id=1` in the URL
    form_for :person, @person, 
             :url => {:action => :something, :id => 99} do |form|
       # blah blah blah...
    end
</code>

Total Stand-up Meeting Time: 13:00 minutes

Standup 02/27/2007

edit Posted by Joe Moore on Tuesday February 27, 2007 at 04:35PM

Interesting Things

  • The has_many_polymorphs plugin is finicky: order of operations is important! If you have problems with your associations after installing HMP, play around with the order of your has_many associations and such.
  • Also, "type is not type": has_many_polymorphs' use of the type column is not the same usage of Single Table Inheritance's (STI) usage of type. If you are using HMP for an ActiveRecord using STI (say, "Student" which extends "Person"), HMP needs to reference the base class/table, not the subclass (i.e. reference Person, not Student.)
  • If your Rspec test seem to be having problems finding the Models, Controllers, etc. that are the test subjects, make sure the directory 'spec test structure is correct: "model" for model tests, "controller" for controller tests, etc. Rspec assumes that these test directories exist.
  • Finally, as if you didn't need to be told so, ActiveRecord will have problems if you create a table with only an id column.

Total Stand-up Meeting Time: 18:00 minutes

Standup 02/26/2007

edit Posted by Joe Moore on Monday February 26, 2007 at 04:37PM

It's Monday, and a blizzard in the Lake Tahoe area has stranded several of our developer. No interesting things for standup today.

Standup 02/23/2007

edit Posted by Joe Moore on Friday February 23, 2007 at 04:36PM

Only project updates today.

Standup 02/21/2007

edit Posted by Joe Moore on Thursday February 22, 2007 at 04:45PM

Interesting Things

  • After the appable_plugins folks applied some of our patches, we upgrade. Thanks guys!
  • Beer suggestions welcome for the retrospective tomorrow!
  • One of our guys presented at the East Bay Ruby Meetup. Subject: Pivotal Labs' Capistrano extensions. Of note: when he asked the group of 45 Ruby enthusiasts who among them knew much about Agile Software Development and continuous integration, only 4-5 people raised their hands. Disappointing.
  • We might present at the O'Reilly Web 2.0 Expo in San Francisco this April (topic TBD). We'll post the details here if it works out.

Ask for Help

  • Is something goofy happening with Rail 1.2 REGEX pattern matching? One group is having problems after the upgrade.
    UPDATE: Not really. It was a case where Rails 1.2 caught the bug that Rails 1.1 did not.

Total Stand-up Meeting Time: 10:00 minutes

Standup 02/22/2007

edit Posted by Joe Moore on Thursday February 22, 2007 at 04:35PM

Interesting Things

  • If you are using named parameters, watch out! A routes-named-parameters bug bit us. It's fixed in Edge Rails but not in a released version of Rails.
  • ... And as a public service announcement, Rails' routing was rewritten for version 1.2. If you are experiencing weird routing behavior, check the bug list.
  • False alarm! The REGEX bug we mentioned the the last standup meeting... our fault.
  • Let's say you have the desperate need to generate a drop-shadow for an image, or any other sort of shadow (haven't we all?). Check out Rmagick's Image::shadow() method, which can do it for you. Very cool stuff!
  • More svn:externals problems. I won't get into the gory details, but if are changing or removing a svn:externals property on a directory, your best bet is to delete that portion of the directory tree and get a fresh version from SVN. You'll avoid most problems.
  • One project is using the Rails Simple Captcha plugin with success, and even has a successful Selenium testing strategy.
  • Watch out for this appable_plugins bug ActiveRecord models in your plugin do not reload when your environment sets config.cache_classes = true. End result: you might get "method missing" errors in your application for methods that the plugin's model declares. Ouch. Details available upon request.

Ask for Help

  • Doh! Somehow we broke ruby script/generate migration MyMigration. I suppose we should fix that.

Total Stand-up Meeting Time: 20:00 minutes

Standup 02/20/2007

edit Posted by Joe Moore on Wednesday February 21, 2007 at 04:41PM

Interesting Things

Ask for Help

  • 4 of our developers are trapped in Flagstaff, AZ! Can anyone give them a ride, perhaps in a short bus?

Total Stand-up Meeting Time: 13:00 minutes

Standup 02/16/2007

edit Posted by Joe Moore on Saturday February 17, 2007 at 06:57AM

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

edit Posted by Joe Moore on Thursday February 15, 2007 at 06:52AM

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

edit Posted by Joe Moore on Thursday February 15, 2007 at 12:12AM

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

Total Stand-up Meeting Time: 14:00 minutes

Other articles: