# Updade distinct model objects in different situations

**URL:** <https://www.ruby-forum.com/t/updade-distinct-model-objects-in-different-situations/119786>\
**Category:** Rails\
**Created:** [November 10, 2007, 2:41pm UTC](https://www.ruby-forum.com/t/updade-distinct-model-objects-in-different-situations/119786 "2007-11-10T14:41:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ranieri\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/43a26b/32.png) [@Ranieri\_T](https://www.ruby-forum.com/u/Ranieri_T)\
**Post date:** [November 10, 2007, 2:41pm UTC](https://www.ruby-forum.com/t/updade-distinct-model-objects-in-different-situations/119786/1 "2007-11-10T14:41:25Z")

</div>

Hi,  
I’m writting a rails app to manage mp3 files online.  
I want to updade distinct model objects in different situations.

1. When an user go to save a new record, I code the controller to  
save all fields to DB, without restrictions. (this was done).

2. When an user go to save an existing record, two cases can happen:

a) the record is of the proper user: so, I want to code the  
controller to show informations to that user, like “the \<file.mp3\> has  
been saved by you. Do you want to edit them?” and display the related  
form. But, I have another solution: only display the informations and  
highlight the mp3 entry. What the best solution, for this case? And,  
if possible, how can I code this?  
b) the record is of another user: so, I want to code the controller  
to show a form with unique input fields readonly, like “title” and  
permit other fields to be salved by the user. But, this time, the  
field ‘description’ will be saved as a comment for the existing entry,  
in a table comments for the model Comment. How can I code this?

When I have a Comment model and need know ‘who’ comments ‘what’ file,  
but the Comment belogs\_to ‘MP3 model’, can I put a user\_id field in  
the comments table? Or would more currect put it in another place? If  
so, where?

Thanks for the support,

Ranieri T.
