
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
mongoid-time_with_named_zone
Advanced tools
Timezones can be a developer's worst nightmare and introduce subtle bugs.
This gem provides a Mongoid wrapper for Time objects that includes and retains the timezone name as a string.
Reading from the database will use the ActiveSupport::TimeWithZone
's monkey patched #in_time_zone
(monkey patched by Mongoid) to convert the time to being a TimeWithZone.
This gem does not apply any monkey patches.
This is necessary because MongoDB can save ISO8601 formatted date strings by using a wrapping type ISODate(), but these don't include the strings representing the name of the timezone. This gem stores timezone string in the database.
with Bundler, add this gem to your Gemfile
:
gem 'mongoid-time_with_named_zone'
requiring manually:
require 'mongoid/time_with_named_zone'
Define your Mongoid models with field types of Mongoid::TimeWithNamedZone
:
e.g.:
class BlogPost
field :published_at, type: Mongoid::TimeWithNamedZone
field :body, type: String
end
and assign attributes to Time instances:
post = BlogPost.new
post.published_at = Time.now.in_time_zone('Pacific/Auckland')
Run rake spec
Once you've made your great commits:
That's it!
See LICENSE
FAQs
Unknown package
We found that mongoid-time_with_named_zone 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
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.