Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding destroy dependency for has_many association

  • Loading branch information...
commit 54f994dfc3cafb781d9bf578934dabeb0f0c4d5b 1 parent c0557d5
Ryan Bates authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  app/models/project.rb
2  app/models/project.rb
View
@@ -1,5 +1,5 @@
class Project < ActiveRecord::Base
- has_many :tasks
+ has_many :tasks, :dependent => :destroy
validates_presence_of :name
accepts_nested_attributes_for :tasks, :reject_if => lambda { |a| a.values.all?(&:blank?) }, :allow_destroy => true
end
Please sign in to comment.
Something went wrong with that request. Please try again.