When i save, rails doesnt update the model instance with the


#1

Hi everybody,

Im using sqlserver (sqlserver adapter).

I think that is some bug.

any idea?


#2

Are your saves working?

unless object.save
raise :Yikes
end

Perhaps your model isn’t validating?


– Tom M.


#3

yes, my saves are working fine…


#4

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 !


#5

Is your ID column set to auto-increment?


– Tom M.


#6

yes …


#7

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.