I've recently read http://blog.teksol.info/articles/2006/03/08/do-not-validate-belongs_to-or-else
and I seem to be experiencing conflicting behavior with Rails 1.2.3
class Parent < ActiveRecord::Base
class Child < ActiveRecord::Base
So from reading the link above, as well as the warning on
I figured this would work.
parent = Parent.new(:name => "Dad")
child = parent.children.build(:name => "Son")
However I consistently get "ActiveRecord::RecordInvalid: Validation
failed: Children is invalid"
This behavior is exhibited with both "validates_presence_of :parent"
However, if I remove the "validates_presence_of :parent_id" both
elements are saved and the Child has been saved with the parent id
Am I mis-reading something, or did this work in previous versions?
Running on Intel Mac, against both SQLite3 and MySQL.