New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New `before_commit` hook in Rails 5? #25896

Adamantish opened this Issue Jul 20, 2016 · 1 comment


None yet
2 participants
Copy link

Adamantish commented Jul 20, 2016

Source indicates yes. Documentation say

This is here

      def before_commit_records
        records.uniq.each(&:before_committed!) if @run_commit_callbacks


    included do
      define_callbacks :commit, :rollback,

I discovered this while patching rails 4.2. I'm making a before_commit_batch callback to be defined at the Model class level and run just once before commit.

It looks like this new feature isn't that but how come no mention of it?


Just found the answer here: #18936


This comment has been minimized.

Copy link

rafaelfranca commented Jul 20, 2016

It is not public API and should be not used in applications. It is for Rails internal usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment