clemens / delocalize

Date/time and number parsing for Rails.

Home Page:http://www.railway.at

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not updating attribute on ocasion

felipekk opened this issue · comments

Hi, I've been using this great gem for a couple of days and I believe I've found a bug:

I've created a new rails app to try to isolate the bug, and I've been successfull:

Currency model migration:
create_table :currencies do |t|
t.decimal :value, :precision => 12, :scale => 2

    t.timestamps
  end

Environment:

config.gem "delocalize"
config.i18n.default_locale = 'pt-BR'

locales/pt-BR.yml:

pt-BR:
  number:
    format:
      separator: ","
      delimiter: .
      precision: 3

Now, on script/console:

http://gist.github.com/263347

Since no changes are detected, the record won't be saved.

The funny thing is: if you set the value to the same string twice, the changes are detected:

http://gist.github.com/263348

Any insights?

Well, now I've noticed that this issue has been solved already and I've only hit it because I have the gem installed from gemcutter, which is not the most up to date code on your repo.

Please release a new gem version.

Thanks

Done. Sorry for that, I wasn't aware that I had forgotten to update the gem.