Elias Orozco wrote: > Hello, > > I have a message model which belongs to a user. Users can be deleted, > but messages cannot. What can I do to reference a user that created a > message when it no longer exists?: > > 1) Create a dummy user. When a user is deleted, assign the dummy user > id to all of its messages. > 2) Have a condition to check if the user exists, if not, don't show > the user info. > 3) Don't really delete the user, just flag it or change its state to > inactive. > > These 3 occured to me. Any other options I should have in > consideration? Which one should I follow? >
I would use 3. 1 is not worth serious consideration (dummy records are seldom good things), and while 2 would work, it wouldn't let you differentiate between messages from different inactive users. > Thanks Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

