Skip to content

Commit

Permalink
fixes #11589 - minor update to product label validation
Browse files Browse the repository at this point in the history
Update to clean up format of validation error as well as
make it consistent with the similar error for repositories.

Before:
  Validation failed: Label Product with label 'zoo' already exists in this organization.

After:
  Validation failed: Label has already been taken for a product in this organization.
  • Loading branch information
bbuckingham committed Aug 27, 2015
1 parent c0d6834 commit 5778eef
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -5,9 +5,7 @@ def validate_each(record, attribute, value)
unique = self.unique_attribute?(record, attribute, value)

unless unique
message = _("Product with %{attribute} '%{id}' already exists in this organization.") %
{:attribute => attribute, :id => value}
record.errors[attribute] << message
record.errors[attribute] << _("has already been taken for a product in this organization.")
end
end

Expand Down

0 comments on commit 5778eef

Please sign in to comment.