openfoodnetwork

https://github.com/openfoodfoundation/openfoodnetwork

Ruby

Connect suppliers, distributors and consumers to trade local produce.

Spree::LocalizedNumber#localize_number

This method overwrites the attribute setters of a model
to make them use the LocalizedNumber parsing method.
It works with ActiveRecord "normal" attributes
and Preference attributes.
It also adds a validation on the input format.
It accepts as arguments a variable number of attribute as symbols

Source | Google | Stack overflow

Edit

git clone [email protected]:openfoodfoundation/openfoodnetwork.git

cd openfoodnetwork

open lib/spree/localized_number.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Spree--LocalizedNumber-localize_number-for-pr


# Commit to git

git add lib/spree/localized_number.rbgit commit -m "better docs for Spree::LocalizedNumber#localize_number"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Spree--LocalizedNumber-localize_number-for-pr

hub pull-request


# Celebrate!