Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

[Standup][sf] 5/20/2011 DVORAK? I hardly knew her!

Ken Mayer
Friday, May 20, 2011

Helps

“Can I use after_initialize to set up nested associations for use with Controller#new actions?”

Not recommended. It is better to write a custom #new_for_form method in your model that pre-populates your instance variables with the 1 or more nested objects. That way you can test drive it, too.

“DelayedJob YAML parser in Ruby 1.9 is having issues.”

The compiled-in psych library has issues, use the tenderlove/psych gem instead. You have to use Bundler, however. Invoking require "psych" will use the compiled-in version.

“RubyMine is not honoring a DVORAK keyboard layout properly (it is mapping keyboard shortcuts to the QWERTY layout)”

Use a hardware dongle.

“Jenkins is trying to kill off Postgres?”

Does anyone have Jenkins CI working with Postgres? It seems that after a build is complete, some java deep down inside Hudson is trying to parse the process table, and it is choking on the Postgres entries. (Postgres re-writes ARGV[0] to display status info, you can’t rely on it be the original command line.) It remains a mystery why Jenkins would even need this information.

“Is anyone using Chrome in CI? The windows are transparent”

Sounds pretty. Odd, but pretty.

Interesting

“brew info … is your friend”

Can’t remember how to start or stop a daemon under OS X? If you installed it via Homebrew you are in luck:

brew info <foo>

Will print out the original install instructions, including exact lines to pass to launchctl(1), etc.

“More ‘special’ keywords to avoid in your models: target and source“

ActiveRecord Polymorphic Associations use a method called target internally. If you have an attribute in your model / database, also called target, then strange things will happen.

“Paperclip’s <model>.attachment.exists? is slow; it goes out to S3 (or whatever the store is)”

And it happens in strange places. Be warned. Or mock out your network calls.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

2 Comments

  1. Mike Perham says:

    Regarding launchctl, you can also use my lunchy gem which turns this:

    launchctl load ~/Library/LaunchAgents/io.redis.redis-server.plist

    into this:

    lunchy start redis

    More info here:

    https://github.com/mperham/lunchy

    May 20, 2011 at 4:05 pm

  2. Peter Jaros says:

    > It is better to write a custom #new_for_form method in your model that pre-populates your instance variables with the 1 or more nested objects. That way you can test drive it, too.

    That’s a great idea! Might I also suggest instead using a method `#prepare_for_form` which does that work and returns `self`? Then you can call:

    @post = Post.new.prepare_for_form

    or

    @post = @user.posts.build.prepare_for_form

    Also, sometimes which associations should be filled out is highly dependent on which form you’re rendering. In that case, you may want to use a form-backing object:

    < https://pivotallabs.com/users/jdean/blog/articles/1706-form-backing-objects-for-fun-and-profit>

    May 22, 2011 at 8:05 am

Add New Comment Cancel reply

Your email address will not be published.

Ken Mayer

Ken Mayer
San Francisco

Recent Posts

  • Why Pivotal
  • Sencha Touch BDD – Part 5 – Controller Testing
  • Sencha Touch BDD – Part 4 – PhantomJS
Subscribe to Ken's Feed

Author Topics

bloggerdome (6)
bdd (5)
jasmine (6)
javascript (5)
mobile (6)
sencha (5)
meta programming (1)
refactoring (1)
ruby (1)
agile (18)
planning (1)
design (2)
heroku (3)
rails (8)
workflow (5)
cucumber (3)
testing (4)
performance (3)
devops (1)
jquery (2)
careers (1)
college job fairs (1)
hiring (1)
jobs (1)
recruitment (1)
bundler (3)
facebook (1)
json (1)
nginx (1)
movember (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >