
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.
Rails' default update_attributes
behavior is that when any validation fails,
none of the data gets saved. However, in some instances this is not the most
ideal behavior. If you import partial data which users then have the task of
completing, not saving partially completed forms can create a really negative
user experience and decrease overall completion (or conversion) rates.
For example, some users complained when their incomplete changes didn't stick bceause they had intended to send the remainder of the form to a colleague to complete the rest.
This gem encapsulates the logic I've used to ensure that partially completed forms still persist.
class Person < ActiveRecord::Base
# Include the module.
include SaveWhatsValid
# These are the attributes available on the model.
attr_accessible :age, :description, :first_name, :last_name, :middle_initial
# These two attributes are required.
validates_presence_of :first_name
validates_presence_of :last_name
# These are the attributes we want to save any valid value for.
save_whats_valid :age, :description, :first_name, :last_name
end
FAQs
Unknown package
We found that save_whats_valid 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
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.