
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
rails_callback_ex
Advanced tools
Insert/delete callbacks for rails.
Add this line to your application's Gemfile:
gem 'rails_callback_ex'
Then execute:
$ bundle
Example:
class SamplesController < ActionController::Base
before_action :action1
before_action :action2
insert_before_action :new_action1, before: :action1
insert_before_action :new_action2, after: :action1
end
SamplesController.__callbacks[:process_action].map(&:filter) #=> [:new_action1, :action1, :new_action2, :action2]
SamplesController.delete_before_action :new_action1
SamplesController.__callbacks[:process_action].map(&:filter) #=> [:action1, :new_action2, :action2]
Example:
class Sample < ActiveRecord::Base
before_save :action1
before_save :action2
insert_before_save :new_action1, before: :action1
insert_before_save :new_action2, after: :action1
end
Sample.__callbacks[:save].map(&:filter) #=> [:new_action1, :action1, :new_action2, :action2]
Sample.delete_before_save :new_action1
Sample.__callbacks[:save].map(&:filter) #=> [:action1, :new_action2, :action2]
Supported callbacks are validation, save, create, update and destroy.
Example:
class SampleJob < ActiveJob::Base
before_perform :action1
before_perform :action2
insert_before_perform :new_action1, before: :action1
insert_before_perform :new_action2, after: :action1
end
SampleJob.__callbacks[:perform].map(&:filter) #=> [:new_action1, :action1, :new_action2, :action2]
SampleJob.delete_before_perform :new_action1
SampleJob.__callbacks[:perform].map(&:filter) #=> [:action1, :new_action2, :action2]
Supported callbacks are enqueue and perform.
Example:
class SampleMailer < ActionMailer::Base
before_deliver :action1
before_deliver :action2
insert_before_deliver :new_action1, before: :action1
insert_before_deliver :new_action2, after: :action1
end
SampleMailer.__callbacks[:deliver].map(&:filter) #=> [:new_action1, :action1, :new_action2, :action2]
SampleMailer.delete_before_deliver :new_action1
SampleMailer.__callbacks[:deliver].map(&:filter) #=> [:action1, :new_action2, :action2]
Supported callback is deliver. Note that deliver callbacks can be used on rails >= 7.1.
Bug reports and pull requests are welcome at https://github.com/kanety/rails_callback_ex.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that rails_callback_ex demonstrated a healthy version release cadence and project activity because the last version was released less than 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.