I have a simple requirement. when i’m updating my_model i’m deleting the record for my_model table and again updating(as it has a foreign key referencing some other model)
when i’m creating a record for my_model i’m creating some entries into movies table(but my_model and movies are not having any relation to each other) . now while updating my_model, I dont want to delete the records in movies table rather i’d like to check if the values exists in movies table. if they exists I want to pick the id from that record and insert into sub_movies table.
However thats a different usecase jacmoe. Because developer! wants to use the actual model id that the find() returns. If you’d use exists() in the if statement, you’d have to do another query inside the if brackets.