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
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Standup 2010-10-25 — Rails 3-related helps and interestings

Andrew Kitchen
Monday, October 25, 2010

Help

  • Edit: followup to delayed_job job logging failures

Switching to resque might help, but not without first rewriting the jobs.

More research yielded the fact that delayed_job reopens all files (including the log files) when it spins up. Under Ruby 1.8, File#reopen defaults file mode to last set, while 1.9 defaults to read only. This could easily cause logging failures. (with a nod to Davis W. Frank for the followup info)

Interesting

  • Calling .destroy on a has_one relationship does not update the record association to nil, which can cause problems when the relationship is subsequently updated. It was suggested that calling .clear on the association might help work around the issue.

  • Rails 3 request helper methods in ActionController::TestCase::Behavior take the session and flash hashes as parameters, as opposed to setting them explicitly before making a normal get request. Compare http://api.rubyonrails.org/classes/ActionController/TestCase/Behavior.html#method-i-get with http://api.rubyonrails.org/classes/ActionDispatch/Integration/RequestHelpers.html#method-i-get for more detail

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

One comment

  1. Nick Gauthier says:

    Interesting #1: This is why you should always use foreign keys in your DB. They can be instructed to raise errors, delete the associated object, or nullify the column for you, and they are faster and more reliable than rails methods.

    October 25, 2010 at 1:12 pm

Add New Comment Cancel reply

Your email address will not be published.

Andrew Kitchen

Andrew Kitchen
San Francisco

Recent Posts

  • Meanwhile, over in Objective-C land
  • Standup 5/19/2011: Down on the form
  • Standup 5/17/2011 — You can't un-ring the bell
Subscribe to Andrew's Feed

Author Topics

cedar (1)
objective-c (1)
twui (1)
agile (4)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • 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 >