Skip to content

Commit

Permalink
Resolve issue#152 (#187)
Browse files Browse the repository at this point in the history
* Resolve issue#152

Use locale message key name instead of the actual message to resolve error message lookup issue.

* Resolve issue#152

Use locale message key name instead of the actual message to resolve error message lookup issue.

* Resolve issue#152

Use locale message key name instead of the actual message to resolve error message lookup issue.
  • Loading branch information
edmondchui authored Aug 22, 2021
1 parent e431b43 commit 1417bff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/spree/feedback_review.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Spree::FeedbackReview < ActiveRecord::Base
only_integer: true,
greater_than_or_equal_to: 1,
less_than_or_equal_to: 5,
message: Spree.t(:you_must_enter_value_for_rating)
message: :you_must_enter_value_for_rating
}

default_scope { most_recent_first }
Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/review.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Spree::Review < ActiveRecord::Base
only_integer: true,
greater_than_or_equal_to: 1,
less_than_or_equal_to: 5,
message: Spree.t(:you_must_enter_value_for_rating)
message: :you_must_enter_value_for_rating
}

default_scope { order('spree_reviews.created_at DESC') }
Expand Down
5 changes: 4 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ en:
ip_address: IP
user: User
show_identifier: Show Identifier
errors:
messages:
you_must_enter_value_for_rating: "You must enter a value for rating."

models:
spree/review:
one: one review
Expand Down Expand Up @@ -65,5 +69,4 @@ en:
other: "%{count} voices"
was_this_review_helpful: "Was this review helpful to you?"
write_your_own_review: Write your own review
you_must_enter_value_for_rating: "You must enter a value for rating."
anonymous: Anonymous

0 comments on commit 1417bff

Please sign in to comment.