Commit 8dc5609 1 parent 5733e8e commit 8dc5609 Copy full SHA for 8dc5609
File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -245,9 +245,14 @@ def perform_action_and_record_errors(&block)
245
245
end
246
246
247
247
# Add the errors from the record
248
- @errors = @record . errors . full_messages . reject { | error | exception_message . include? error } . unshift exception_message
248
+ @errors = @record . errors . full_messages
249
249
250
- succeeded
250
+ # Remove duplicated errors
251
+ if exception_message . present?
252
+ @errors = @errors . reject { |error | exception_message . include? error } . unshift exception_message
253
+ end
254
+
255
+ @errors . any? ? false : succeeded
251
256
end
252
257
253
258
def model_params
Original file line number Diff line number Diff line change 6
6
around do |example |
7
7
Comment . before_destroy do
8
8
errors . add ( :base , "Some Errors" )
9
-
10
- throw ( :abort )
11
9
end
12
10
13
11
example . run
You can’t perform that action at this time.
0 commit comments