Skip to content
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

Show errors when has_many restrict_with_error. #961

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

vgsantoniazzi
Copy link
Contributor

  • Return full_messages with new line separator

orders - administrate prototype 2017-08-10 12-30-35


order.destroy

expect(order.errors[:base]).to eq(["Cannot delete record because dependent payments exist"])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [96/80]

if requested_resource.destroy
flash[:notice] = translate_with_resource("destroy.success")
else
flash[:error] = requested_resource.errors.full_messages.join("<br/>").html_safe

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [87/80]

order.destroy

expect(order.errors[:base]).to eq(
["Cannot delete record because dependent payments exist"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a comma after the last parameter of a multiline method call.

order.destroy

expect(order.errors[:base]).to eq(
["Cannot delete record because dependent payments exist"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a comma after the last parameter of a multiline method call.

@vgsantoniazzi vgsantoniazzi force-pushed the master branch 2 times, most recently from 133f77a to ade6fca Compare August 10, 2017 15:44
@nickcharlton
Copy link
Member

This is looking good!

Would you be able to provide a screenshot for when you have multiple errors? From reading the implementation, it looks like it'll add a <br>, but I'm curious to know if it ends up looking a bit odd.

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some files could not be reviewed due to errors:

.rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Na...
.rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming
.rubocop.yml: Style/AlignParameters has the wrong namespace - should be Layout
.rubocop.yml: Style/AsciiIdentifiers has the wrong namespace - should be Naming
.rubocop.yml: Style/DotPosition has the wrong namespace - should be Layout
.rubocop.yml: Style/ExtraSpacing has the wrong namespace - should be Layout
.rubocop.yml: Style/FileName has the wrong namespace - should be Naming
.rubocop.yml: Style/MultilineOperationIndentation has the wrong namespace - should be Layout
.rubocop.yml: Style/MultilineMethodCallIndentation has the wrong namespace - should be Layout
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/InitialIndentation has the wrong namespace - should be Layout
Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was never being actually triggered.
(obsolete configuration found in .rubocop.yml, please update it)
The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some files could not be reviewed due to errors:

.rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Na...
.rubocop.yml: Style/AccessorMethodName has the wrong namespace - should be Naming
.rubocop.yml: Style/AlignParameters has the wrong namespace - should be Layout
.rubocop.yml: Style/AsciiIdentifiers has the wrong namespace - should be Naming
.rubocop.yml: Style/DotPosition has the wrong namespace - should be Layout
.rubocop.yml: Style/ExtraSpacing has the wrong namespace - should be Layout
.rubocop.yml: Style/FileName has the wrong namespace - should be Naming
.rubocop.yml: Style/MultilineOperationIndentation has the wrong namespace - should be Layout
.rubocop.yml: Style/MultilineMethodCallIndentation has the wrong namespace - should be Layout
.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
.rubocop.yml: Style/InitialIndentation has the wrong namespace - should be Layout
Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was never being actually triggered.
(obsolete configuration found in .rubocop.yml, please update it)
The `Style/OpMethod` cop has been renamed and moved to `Naming/BinaryOperatorParameterName`.

* Return full_messages with new line separator
@vgsantoniazzi
Copy link
Contributor Author

selection_002

@vgsantoniazzi
Copy link
Contributor Author

@nickcharlton seems good?

@nickcharlton
Copy link
Member

This looks great! I'm going to go ahead and merge.

@nickcharlton nickcharlton merged commit a6a8f7e into thoughtbot:master Mar 2, 2018
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.

3 participants