
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
active_model_coercions
Advanced tools
Currently, it's just an experimental coercion proof of concept for ActiveModel objects. However if you see some areas of improvement or want to discuss some stuff - feel free to open an issue/pull request.
Add this line to your application's Gemfile:
gem 'active_model_coercions'
And then execute:
$ bundle
Or install it yourself as:
$ gem install active_model_coercions
class TestModel
include ActiveModel::Model
include ActiveModel::Coercions
attr_accessor :number, :date, :state
attribute :number, :integer
attribute :state, :symbol
end
params = {number: '1', state: 'active'}
model = TestModel.new(params)
model.number # => 1
model.state # => :active
model.attributes # => {number: 1, state: :active}
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that active_model_coercions 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.