![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Simple ruby on rails validator that checks if a value is a valid [ISO4217] (http://en.wikipedia.org/wiki/ISO_4217) code.
Examples of ISO4217 codes: EUR, USD, CHF, TWD, INR.
Add this line to your application's Gemfile:
gem 'iso4217-validator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install iso4217-validator
Include the validator in your model attribute this way:
class TestModel < ActiveRecord::Base
include Iso4217::Validator
validates :currency_code, iso4217Code: true
end
currency_code attribute shall be defined as an string.
If the currency_code is invalid the validator adds an :invalid message error. If you want to customize the error message you can use:
class TestModel < ActiveRecord::Base
include Iso4217::Validator
validates :currency_code, iso4217Code: {message: "Oh! That's an invalid currency code."}
end
Please bear in mind that the validator is case sensitive. So 'EUR' is a valid code but 'eur' is not.
git checkout -b my-new-feature
)git commit -am 'Add some feature with tests'
)git push origin my-new-feature
)Please add unit tests when including new features.
Source of the valid code list used: http://www.currency-iso.org/en/home/tables/table-a1.html The last version included in the gem: August 15, 2014.
The gem source includes an script (bin/extractor.rb) that can extract the codes from the excel file and convert it into the ruby array which is used by the validator. You can find more instructions within the extractor.rb file.
Copyright (c) 2014 Juan M. Merlos. Distributed under MIT License
FAQs
Unknown package
We found that iso4217-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.