Noel R. Morais
2006-Feb-24 20:27 UTC
[Rails] when i save, rails doesnt update the model instance with the id of the new record
Hi everybody, Im using sqlserver (sqlserver adapter). I think that is some bug. any idea? -- _________ Noel R. Morais
Tom Mornini
2006-Feb-24 20:45 UTC
[Rails] when i save, rails doesnt update the model instance with the id of the new record
Are your saves working? unless object.save raise :Yikes end Perhaps your model isn''t validating? -- -- Tom Mornini On Feb 24, 2006, at 12:27 PM, Noel R. Morais wrote:> Hi everybody, > > Im using sqlserver (sqlserver adapter). > > I think that is some bug. > > any idea? > > > -- > _________ > Noel R. Morais > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Noel R. Morais
2006-Mar-15 23:09 UTC
[Rails] when i save, rails doesnt update the model instance with the id of the new record
yes, my saves are working fine.... On 2/24/06, Tom Mornini <tmornini@infomania.com> wrote:> Are your saves working? > > unless object.save > raise :Yikes > end > > Perhaps your model isn''t validating? > > -- > -- Tom Mornini > > > On Feb 24, 2006, at 12:27 PM, Noel R. Morais wrote: > > > Hi everybody, > > > > Im using sqlserver (sqlserver adapter). > > > > I think that is some bug. > > > > any idea? > > > > > > -- > > _________ > > Noel R. Morais > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- _________ Noel R. Morais
Francois Beausoleil
2006-Mar-16 02:03 UTC
[Rails] when i save, rails doesnt update the model instance with the id of the new record
2006/2/24, Noel R. Morais <noelrocha@gmail.com>:> 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 ! -- Fran?ois Beausoleil http://blog.teksol.info/
Noel R. Morais
2006-Mar-17 14:39 UTC
[Rails] when i save, rails doesnt update the model instance with the id of the new record
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. On 3/15/06, Francois Beausoleil <francois.beausoleil@gmail.com> wrote:> 2006/2/24, Noel R. Morais <noelrocha@gmail.com>: > > 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 ! > -- > Fran?ois Beausoleil > http://blog.teksol.info/ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- _________ Noel R. Morais
Tom Mornini
2006-Mar-17 16:34 UTC
[Rails] when i save, rails doesnt update the model instance with the id of the new record
Is your ID column set to auto-increment? -- -- Tom Mornini On Mar 17, 2006, at 6:39 AM, Noel R. Morais wrote:> 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. > > On 3/15/06, Francois Beausoleil <francois.beausoleil@gmail.com> wrote: >> 2006/2/24, Noel R. Morais <noelrocha@gmail.com>: >>> 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 ! >> -- >> Fran?ois Beausoleil >> http://blog.teksol.info/ >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> > > > -- > _________ > Noel R. Morais > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Noel R. Morais
2006-Mar-17 18:29 UTC
[Rails] when i save, rails doesnt update the model instance with the id of the new record
yes ..... On 3/17/06, Tom Mornini <tmornini@infomania.com> wrote:> Is your ID column set to auto-increment? > > -- > -- Tom Mornini > > > On Mar 17, 2006, at 6:39 AM, Noel R. Morais wrote: > > > 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. > > > > On 3/15/06, Francois Beausoleil <francois.beausoleil@gmail.com> wrote: > >> 2006/2/24, Noel R. Morais <noelrocha@gmail.com>: > >>> 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 ! > >> -- > >> Fran?ois Beausoleil > >> http://blog.teksol.info/ > >> > >> _______________________________________________ > >> Rails mailing list > >> Rails@lists.rubyonrails.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > >> > >> > > > > > > -- > > _________ > > Noel R. Morais > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- _________ Noel R. Morais