So I was trying to just get an array of posts that do not include @post. To my surprise the code below resulted in @post being deleted from the database!
@post = Post.find(2)
@posts = Post.where(:text => "title")
@posts.delete(@post)
Why does an Array function delete @post from the database? Does Rails extend or overwrite this function? I thought only the .destroy function can delete objects from the database? I guess I am confused on what exactly the .where function returns and the consequences of using @ and not using @ for variables.
Thanks in advance!