Skip to content

Commit

Permalink
Error message generation methods should not have public visibility
Browse files Browse the repository at this point in the history
- [ close #2191 ]
  • Loading branch information
durran committed Jul 12, 2012
1 parent 352fc03 commit 9bbdeaa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,9 @@ For instructions on upgrading to newer versions, visit

### Resolved Issues

* \#2191 Ensure proper visibility (private) for error message generation
methods.

* \#2187 Ensure all levels of nested documents are serialized in json.

* \#2184 Allow names of relations that conflict with ruby core kernel
Expand Down
17 changes: 14 additions & 3 deletions lib/mongoid/errors/mongoid_error.rb
Expand Up @@ -23,6 +23,8 @@ def compose_message(key, attributes)
"\nResolution:\n #{resolution(key, attributes)}"
end

private

# Given the key of the specific error and the options hash, translate the
# message.
#
Expand All @@ -40,7 +42,10 @@ def translate(key, options)
# Create the problem.
#
# @example Create the problem.
# error.problem
# error.problem("error", {})
#
# @param [ String, Symbol ] key The error key.
# @param [ Hash ] attributes The attributes to interpolate.
#
# @return [ String ] The problem.
#
Expand All @@ -52,7 +57,10 @@ def problem(key, attributes)
# Create the summary.
#
# @example Create the summary.
# error.summary
# error.summary("error", {})
#
# @param [ String, Symbol ] key The error key.
# @param [ Hash ] attributes The attributes to interpolate.
#
# @return [ String ] The summary.
#
Expand All @@ -64,7 +72,10 @@ def summary(key, attributes)
# Create the resolution.
#
# @example Create the resolution.
# error.resolution
# error.resolution("error", {})
#
# @param [ String, Symbol ] key The error key.
# @param [ Hash ] attributes The attributes to interpolate.
#
# @return [ String ] The resolution.
#
Expand Down

0 comments on commit 9bbdeaa

Please sign in to comment.