Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Etat is a minimalistic gem to help you (me, for now) manage some states in your app. It is built for Rails 4 and assumes the use of ActiveRecord 4. See the 'usage' section for more.
Etat means "State" in French.
Add this line to your application's Gemfile:
gem 'etat'
And then execute:
$ bundle
class MyModel < ActiveRecord::Base
has_states :draft, :published, :deleted
event :publish do
# some code to happen on publish...
self.state = :publish
self.save!
end
end
Etat will generate a few methods and scopes that will help you:
MyModel.states
will give you an array of the states. # [:draft, :published, :deleted]
MyModel.all_published
: scope that will return all records with that state (and equivalents for each states).
MyModel.all_but_published
: scope that will return all records except the ones with that state (and equivalents for each states).
my_model_instance.state
: it will return the current state, as a symbol, always.
my_model_instance.published?
: boolean. Will tell you if current record has that state or not (and equivalents for each states).
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that etat 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.