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

10/19/12: Super Happy Blogging Friday

David Varvel
Friday, October 19, 2012

Interestings

  • accepts_nested_attributes and validates_presense_of on association id fails without inverse_of

Having a validation that the association id is present when trying to use nested attributes fails because the child object is validated before the parent object in memory has an id.

However, if you decorate the association with :inverse_of, it tells Rails to look in memory first which both saves memory and allows Rails to build the graph of objects correctly with validation!

Yay inverse_of!

Events

  • Super Happy Dev House in SF tomorrow

Mother of all hack days. They’re usually down in the valley! http://shdh52.eventbrite.com/

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

David Varvel

David Varvel
San Francisco

Recent Posts

  • Responsive web design with GroundworkCSS: Column stacking
  • Backbone vs Rails: Some things to consider
Subscribe to David's Feed

Author Topics

  • 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 >