> i am playing with some test application in console: creating a model, > saving it, changing its id, trying to save it again, changing the id
Why are you changing it's id? You probably shouldn't be doing that... > back, saving again, etc. > The results are sometimes unexpected, but maybe i just do not understand > how/when the records are saved. > > Can anybody please tell me if calling the "save" method saves the model > immediately? > If not, what is the method to save it immediately? > > I keep an Sqlite database browser open (a Firefox extension), and it > seems that some "save" calls have no effect, but after changing some > attributes, the "save" works again. > I wonder if it is because of my messing around with id, or just the data > base does not get updated immediately. Do you have any validations on the model that might be failing? save will return false if validations fail, but won't throw a fit... and obviously won't save the record. Try save! which will throw a fit. Or ask the model for it's errors... -philip > > Thanks. > > -- > 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. > -- 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.

