
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
globalize-validations
Advanced tools
Globalize Validations validates your translated attributes for each given locales.
The errors are added to the globalize attributes accessor names (example title_en
).
globalize-validations
is compatible with Rails 5.2, Rails 6.x and Rails 7.0.x.
API documentation is available at rdoc.info.
Add this line to your application's Gemfile:
gem 'globalize-validations'
And then execute:
$ bundle
Default
class Page < ActiveRecord::Base
translates :title, :body
globalize_accessors locales: [:en, :es, :fr, :pl], attributes: [:title]
globalize_validations # Will use Model.globalize_locales by default
# Add all your validations before
validate :validates_globalized_attributes
end
With custom locales
class Page < ActiveRecord::Base
translates :title, :body
globalize_accessors locales: [:en, :es, :fr, :pl], attributes: [:title]
globalize_validations locales: [:en, :es] # Validates only `:en` and `:es` locales
# Add all your validations before
validate :validates_globalized_attributes
end
With custom locales as Proc
class Page < ActiveRecord::Base
translates :title, :body
globalize_accessors locales: [:en, :es, :fr, :pl], attributes: [:title]
globalize_validations locales: Proc.new { |page| page.available_locales }
# Add all your validations before
validate :validates_globalized_attributes
end
Copyright (c) 2014 BookingSync released under the MIT license
FAQs
Unknown package
We found that globalize-validations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.