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

No delete for you today

Andreas Maier
Thursday, January 10, 2013

Interestings

Don’t use delete_all

Let’s say you have a has_many relationship – project has_many stories. You don’t have dependent: destroy on the association.

If you call project.stories.delete_all, it does not delete the stories. Instead, it inserts NULL into the stories’ project_id field.

As a bonus, if the project_id field in the stories table has a not null constraint, then all of the project_ids become 0 – potentially attaching themselves to a completely different project.

delete_all works properly if the association has a dependent: destroy clause, and destroy_all works properly in either case.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Rails dies again

Andreas Maier
Wednesday, January 9, 2013

Helps

Change Lobot instance type on EC2

We are running on a c1.medium( 1.75GB memory, 5CU) and want to change to something like m1.large or m1.medium with more generous memory allocation. What would be the best way to do it? Change the type from EC2 console or start from scratch?

Interestings

New Severe Rails Vulnerability

All versions of Rails are affected. There are multiple weaknesses in the parameter parsing code for Ruby on Rails which allows attackers to bypass authentication systems, inject arbitrary SQL, inject and execute arbitrary code, or perform a DoS attack on a Rails application.

It is recommended for everyone to upgrade immediately to patched version.

Multiple vulnerabilities in parameter parsing in Action Pack

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Andreas Maier

Andreas Maier
San Francisco

Subscribe to Andreas'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 >