Hi Ken, I just checked the APIs, and since the new Rails 3.0 got release last week or so, all the api sites have the latest docs. Rails 2.3.X does not support the :restrict option, according to the docs. Rails 3.0 does, though. What version of Rails are you running?
Regards, Adam On Tue, Sep 7, 2010 at 10:01 AM, Ken Hudson <[email protected] > wrote: > Hi All, > > According to the Rails documentation, has_many associations have a > :dependent option that can be set to :restrict. "If set to :restrict this > object cannot be deleted if it has any associated object". This is what I > wanted so I have the following code in my gallery model: > > has_many :images, :dependent => :restrict > > However, I am getting the following error: > > "ArgumentError: The :dependent option expects either :destroy, :delete_all, > or :nullify (:restrict)" > > Any idea what my problem is? I'm not sure why :restrict is shown in > parentheses in the error message. The documentation clearly shows it as a > valid option for :dependent... > > Thanks, Ken > > > > > > > > > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
