Forum: Ruby on Rails when i save, rails doesnt update the model instance with the

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Noel R. Morais (Guest)
on 2006-02-24 22:30
(Received via mailing list)
Hi everybody,

Im using sqlserver (sqlserver adapter).

I think that is some bug.

any idea?
Tom M. (Guest)
on 2006-02-24 22:45
(Received via mailing list)
Are your saves working?

unless object.save
   raise :Yikes
end

Perhaps your model isn't validating?

--
-- Tom M.
Noel R. Morais (Guest)
on 2006-03-16 01:10
(Received via mailing list)
yes, my saves are working fine....
François B. (Guest)
on 2006-03-16 04:05
(Received via mailing list)
2006/2/24, Noel R. Morais <removed_email_address@domain.invalid>:
> Im using sqlserver (sqlserver adapter).
>
> I think that is some bug.
>
> any idea?

Are you saying that you change the model's ID and that the save does
not update the ID of the record ?

I'm not sure that changing the ID is supported.

Check the log to see what gets saved.

Hope that helps !
Noel R. Morais (Guest)
on 2006-03-17 16:40
(Received via mailing list)
What is happening is that when i do:

m = Model.new
m.description = 'Another test'
puts 'Work fine' if m.save
puts 'The attribute ID wasn't updated' if m.id.nil?
m = Model.find(:first, :order => 'id desc' )
puts m.description

The output is:
$: Work fine
$: The attribute ID wasn't updated
$: Another test

The record was inserted but the model object wasn't updated with the
id of the new record.
Tom M. (Guest)
on 2006-03-17 18:37
(Received via mailing list)
Is your ID column set to auto-increment?

--
-- Tom M.
Noel R. Morais (Guest)
on 2006-03-17 20:32
(Received via mailing list)
yes .....
This topic is locked and can not be replied to.