stack
2009-Jan-14 01:17 UTC
[PATCH] Setting a decimal from 0.0 to '''' doesn''t constitute a change
If a model has a decimal value which is currently set to 0.0 and the field is blanked out with an empty string (like when submitting an empty text_field for the value), the dirty objects code does not recognize a change. http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1754-setting-a-decimal-from-00-to-doesnt-constitute-a-change --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Mislav Marohnić
2009-Jan-14 01:42 UTC
Re: [PATCH] Setting a decimal from 0.0 to '''' doesn''t constitute a change
Isn''t this expected behavior?"".to_i == 0.0 #=> true You are saying that assigning an empty string should nulify the value? On Wed, Jan 14, 2009 at 02:17, stack <stephen@shortround.net> wrote:> > If a model has a decimal value which is currently set to 0.0 and the > field is blanked out with an empty string (like when submitting an > empty text_field for the value), the dirty objects code does not > recognize a change. > > > http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1754-setting-a-decimal-from-00-to-doesnt-constitute-a-change > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
stack
2009-Jan-14 03:52 UTC
Re: [PATCH] Setting a decimal from 0.0 to '''' doesn''t constitute a change
If you build a form to edit a model that has a decimal, you cannot blank out the value if it was originally 0.0. There is an exception for this for integers, just not decimals. On Jan 13, 8:42 pm, "Mislav Marohnić" <mislav.maroh...@gmail.com> wrote:> Isn''t this expected behavior?"".to_i == 0.0 #=> true > > You are saying that assigning an empty string should nulify the value? > > > > On Wed, Jan 14, 2009 at 02:17, stack <step...@shortround.net> wrote: > > > If a model has a decimal value which is currently set to 0.0 and the > > field is blanked out with an empty string (like when submitting an > > empty text_field for the value), the dirty objects code does not > > recognize a change. > > >http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/17...--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Jan-14 10:56 UTC
Re: [PATCH] Setting a decimal from 0.0 to '''' doesn''t constitute a change
This the same as http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1692-setting-a-decimal-from-00-to-doesnt-constitute-a-change which should be applied soon. Fred On 14 Jan 2009, at 03:52, stack wrote:> > If you build a form to edit a model that has a decimal, you cannot > blank out the value if it was originally 0.0. There is an exception > for this for integers, just not decimals. > > On Jan 13, 8:42 pm, "Mislav Marohnić" <mislav.maroh...@gmail.com> > wrote: >> Isn''t this expected behavior?"".to_i == 0.0 #=> true >> >> You are saying that assigning an empty string should nulify the >> value? >> >> >> >> On Wed, Jan 14, 2009 at 02:17, stack <step...@shortround.net> wrote: >> >>> If a model has a decimal value which is currently set to 0.0 and the >>> field is blanked out with an empty string (like when submitting an >>> empty text_field for the value), the dirty objects code does not >>> recognize a change. >> >>> http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/17 >>> ... > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---