Tuesday, November 22, 2011

[Rails] Re: ActiveRecord :dependent fails for me

On Nov 22, 4:41 am, RubyNewbie <calvinanhngu...@gmail.com> wrote:
> Hi. I'm instantiating the movie via a finder, such as @movie =
> Movie.find(params[:id])
> and then calling @move.delete. I've seen this issue with my running
> web application as well as any attempt using the rails console.
>
> I haven't tried @movie.destroy because I don't have a before or after
> destroy callback defined.

Actually you do - it's how :dependent is implemented. 99.9% of the
time you want to call destroy on AR objects, not delete.

--Matt Jones

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate