-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5688: Run callbacks for children within fibers (#5837)
* Run callbacks for children within fibers * Comments for run child callbacks with around fibers * Removed the recursive implementation and renamed the fiber implementation to match the original function declaration * Message, summary, and resolution of invalid around callback implementation error * Class for invalid around callback error * try catch block to raise invalid around callbacks error when it is defined without a yield statement (it causes a terminated fiber to be resumed * Require the invalid around callback error * Refactored the rescuing of the exception to make it more elegant * invalid around callback error file is linter-approved * Fixed indentation for the rescue block * Spec for the case a user incorrectly defines an around callback without a yield * raising an invalid around callback error earlier on as soon as a fiber is detected to be dead * Changed the names of the classes for the invalid around callback spec * Modified the class names for the around callback without yield to avoid conflicts * Made the creation fo embedded documents in the around callbacks without yield spec more concise * Update spec/mongoid/interceptable_spec.rb to use logger Co-authored-by: Jamis Buck <[email protected]> * removed the temporary field --------- Co-authored-by: Jamis Buck <[email protected]>
- Loading branch information
1 parent
07761c8
commit c5e092a
Showing
5 changed files
with
70 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module Mongoid | ||
module Errors | ||
# This error is raised when an around callback is | ||
# defined by the user without a yield | ||
class InvalidAroundCallback < MongoidError | ||
# Create the new error. | ||
# | ||
# @api private | ||
def initialize | ||
super(compose_message('invalid_around_callback')) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters