Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make the parent FK field optional

DM changed the default behavior of `belongs_to` to
be required by default.
  • Loading branch information...
commit 11284ff6d78b7a5b4eb1dd2256fef26037500431 1 parent 0d375d6
Martin Gamsjaeger authored February 10, 2012

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  lib/dm-is-awesome_set.rb
3  lib/dm-is-awesome_set.rb
@@ -39,7 +39,8 @@ def is_awesome_set(options={})
39 39
         property :rgt, Integer, :writer => :private, :index => true
40 40
 
41 41
         class_opts = {:model => self.name, :child_key => opts[:child_key], :order => [:lft.asc] }
42  
-        belongs_to :parent,  class_opts
  42
+
  43
+        belongs_to :parent,   class_opts.merge!(:required => false)
43 44
         has n,     :children, class_opts
44 45
 
45 46
         before :save do

0 notes on commit 11284ff

Please sign in to comment.
Something went wrong with that request. Please try again.