It uses singular objects. I am sorry I typed it wrongly over here. I tried to debug it using console. My observation was if: @photo.album.upduser = @currentuser is same as previous user then timestamps are not getting changes. However, @photo.album.save works and returns true.
Any clues? Thanks, CS. Chris Hanks wrote: > Well, the updated_at timestamp for the album should update automatically > to the current time whenever the album model is changed and saved, so if > you're trying to do that then you don't need to use touching. > > I'm confused at how your app is set up - if album has_many photos and > photo belongs_to album, then shouldn't your photo saving method use > singular objects? As in: > > @photo.album.updated_by = @currentusername > @photo.album.save > > That is, assuming you've defined "updated_by" in your migration as a > string to save the name of the current user - I think that's what you're > going for. > > What I would do next is put debugger right between those two lines, then > call the save as a bang method (@photo.album.save!) and see what error > you get (if any). > > Chris > -- 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 -~----------~----~----~----~------~----~------~--~---

