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

Hi everybody,

Im using sqlserver (sqlserver adapter).

I think that is some bug.

any idea?

Are your saves working?

unless object.save
raise :Yikes
end

Perhaps your model isn’t validating?


– Tom M.

yes, my saves are working fine…

2006/2/24, Noel R. Morais [email protected]:

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 !

Is your ID column set to auto-increment?


– Tom M.

yes …

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs