Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default subunit_unit to what was set in the config #78

Merged
merged 1 commit into from
Feb 12, 2013
Merged

Default subunit_unit to what was set in the config #78

merged 1 commit into from
Feb 12, 2013

Conversation

ollym
Copy link
Contributor

@ollym ollym commented Feb 2, 2013

Damn you americans.

@deepak
Copy link
Contributor

deepak commented Feb 4, 2013

+1 ❤️

@deepak
Copy link
Contributor

deepak commented Feb 4, 2013

how will you handle https://github.com/RubyMoney/money-rails/blob/master/lib/money-rails/active_model/validator.rb#L24 ?

code snippet

 currency = record.send("currency_for_#{attr}")
 decimal_mark = I18n.t('number.currency.format.separator', default: currency.decimal_mark)
 thousands_separator = I18n.t('number.currency.format.delimiter', default: currency.thousands_separator)
 symbol = I18n.t('number.currency.format.unit', default: currency.symbol)

maybe let the key be

decimal_mark = I18n.t("number.currency-#{currency.iso_code}.format.separator", default: currency.decimal_mark)

@alup
Copy link
Member

alup commented Feb 6, 2013

Some tests would be welcome here :)

@ollym
Copy link
Contributor Author

ollym commented Feb 7, 2013

@deepak I'm not sure how your comment is relavent to this?

@deepak
Copy link
Contributor

deepak commented Feb 8, 2013

@ollym i had created a PR #75
which is also concerned with supporting other currencies and i found this PR useful

I am using money-rails in a current project and am going through the code.

My commit is not directly relevant to your commit
But wanted to pick @alup and your brain on how will you handle currency_separator and other configs

options:

  1. money-rails config is the single source of truth
  2. specify currency in I18n config

As i said, it is not directly related to your commit
But i though it was interesting

Did not submit a PR for the same as i am using a custom validator
My input is an BigDecimal not a humanized string

alup added a commit that referenced this pull request Feb 12, 2013
Default subunit_unit to what was set in the config
@alup alup merged commit e563f9d into RubyMoney:master Feb 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants