Introduce after_{create,update,delete}_commit callbacks #22516

Merged
merged 1 commit into from Dec 6, 2015

Conversation

Projects
None yet
4 participants
@gsamokovarov
Contributor

gsamokovarov commented Dec 6, 2015

Those are actually shortcuts for after_commit.

Before:

after_commit :add_to_index_later, on: :create
after_commit :update_in_index_later, on: :update
after_commit :remove_from_index_later, on: :destroy

After:

after_create_commit  :add_to_index_later
after_update_commit  :update_in_index_later
after_destroy_commit :remove_from_index_later

Fixes #22515.

@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Dec 6, 2015

r? @senny

(@rails-bot has picked a reviewer for you, use r? to override)

r? @senny

(@rails-bot has picked a reviewer for you, use r? to override)

Introduce after_{create,update,delete}_commit callbacks
Those are actually shortcuts for `after_commit`.

Before:

    after_commit :add_to_index_later, on: :create
    after_commit :update_in_index_later, on: :update
    after_commit :remove_from_index_later, on: :destroy

After:

    after_create_commit  :add_to_index_later
    after_update_commit  :update_in_index_later
    after_destroy_commit :remove_from_index_later
@dhh

This comment has been minimized.

Show comment
Hide comment
@dhh

dhh Dec 6, 2015

Member

Lovely! You're fast 👌

Member

dhh commented Dec 6, 2015

Lovely! You're fast 👌

dhh added a commit that referenced this pull request Dec 6, 2015

Merge pull request #22516 from gsamokovarov/after-create-update-destr…
…oy-commit

Introduce after_{create,update,delete}_commit callbacks

@dhh dhh merged commit a246a69 into rails:master Dec 6, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@yasaichi yasaichi referenced this pull request in yasaichi/everett Dec 26, 2016

Merged

Fix bug of after_{create,update,destroy}_commit callbacks #3

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