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

Reply via email to