-
Notifications
You must be signed in to change notification settings - Fork 3
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
[WIP] Bang Validations #10
Open
davesims
wants to merge
13
commits into
rewinfrey:master
Choose a base branch
from
davesims:bang-validations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+411
−78
Open
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
23e4048
Add bang support for validates_around
davesims ba72c3c
WIP!! Experiment with extra attr on validations for raising
davesims b28da4c
Default validates_around to not raise errors; update tests
davesims 1e2018a
Test for exceptions thrown with around validations for custom types
davesims 00578ba
Added tests for ValidateAroundPresenceTestTaskWithBang
davesims dbd4f6d
Test for around validations with custom presence
davesims dcf12de
Added test for ValidateAroundTestUseCaseWithBang required attributes
davesims 0a90d51
ActionUseCase test for around validations with custom types
davesims 995ba45
ActiveUseCase around validation with presence test
davesims 4172fd4
ActiveUseCase tests for around validation with custom presence
davesims a78b5d2
update to ruby 3
davesims 8b75a60
Convert current before methods to bang!
davesims 3625f2c
Adding tests for before validation, no bang
davesims File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Adding tests for before validation, no bang
commit 3625f2cecca9b14580008f5786b25b90c2e5a2f7
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,10 @@ def validates_before!(args) | |
@validates_before = args.merge(raise_action_logic_exception: true) | ||
end | ||
|
||
def validates_before(args) | ||
@validates_before = args.merge(raise_action_logic_exception: false) | ||
end | ||
|
||
def validates_after(args) | ||
@validates_after = args.merge(raise_action_logic_exception: true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know how I feel about using an extra attribute to signal the validation classes. This is just a rough draft. If this is the approach to take, it needs to be a very specific name to avoid potential collisions, hence "raise_action_logic_exception". |
||
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will eventually eliminate this dupe, but for now I just wanted to see what it looked like to use the
validations
hash to signal to the validation classes whether to raise an exception or not.