Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. p = Parent.new # with a missing required attribute
  2. c = Child.new
  3. c.parent = p # or c.parents << p, this isn't important
  4. p.valid? # false
  5. c.valid? # true
  6. c.save # true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement