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

Closed
Adamantish opened this Issue Jul 20, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@Adamantish
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
      end

and

    included do
      define_callbacks :commit, :rollback,
                       :before_commit,
                       :before_commit_without_transaction_enrollment,

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?

Update

Just found the answer here: #18936

@rafaelfranca

This comment has been minimized.

Copy link
Member

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