
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
track current_user
et all in a tidy, global, and thread-safe fashion.
most rails apps scatter a bunch of @current_foobar
vars everywhere. don't do that. it's fugly. instead, do this.
declare the current_XXX
variables you'll want tracked. you can pass a block for lazy computation
class ApplicationController
Current(:user){ User.find session[:current_user }
Current(:account)
end
you can now access the current state two ways
if Current.user
...
end
Current.user = User.find(id)
current_
methods that are added by including the Current module
into any class (ActionController::Base and ActionView::Base automatically
include it)
if current_user
...
end
self.current_user = User.find(id)
the Current
module is cleared out before every request and is thread safe.
gem install rails_current
gem 'rails-current', :require => 'current'
bundle install
FAQs
Unknown package
We found that rails_current 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
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.