On 29 Mar 2011, at 19:37, "Alexey M." <lists@ruby-forum.com> wrote:
> Hello,
> 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
> 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?
It will, as long as validations passed and at least some attributes have changed. Changing the id could conceivably cause odd things.
Fred
> 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.
>
> 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 rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment