Skip to content

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

Merged
dhh merged 1 commit into
rails:masterfrom
gsamokovarov:after-create-update-destroy-commit
Dec 6, 2015
Merged

Introduce after_{create,update,delete}_commit callbacks#22516
dhh merged 1 commit into
rails:masterfrom
gsamokovarov:after-create-update-destroy-commit

Conversation

@gsamokovarov
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown

r? @senny

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

@gsamokovarov gsamokovarov force-pushed the after-create-update-destroy-commit branch 2 times, most recently from 2cbd5d2 to 76ed730 Compare December 6, 2015 17:45
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
@gsamokovarov gsamokovarov force-pushed the after-create-update-destroy-commit branch from 76ed730 to 5a300b2 Compare December 6, 2015 18:35
@dhh
Copy link
Copy Markdown
Member

dhh commented Dec 6, 2015

Lovely! You're fast 👌

dhh pushed a commit that referenced this pull request Dec 6, 2015
…oy-commit

Introduce after_{create,update,delete}_commit callbacks
@dhh dhh merged commit a246a69 into rails:master Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants