Skip to content

Commit

Permalink
Deprecating ClassyEnum::Base#name
Browse files Browse the repository at this point in the history
Method name is too ambiguous and says nothing about what it actually did
  • Loading branch information
beerlington committed Jul 20, 2012
1 parent c070b24 commit af151e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CHANGELOG.md
@@ -1,5 +1,10 @@
# ClassyEnum Changelog

## 2.3.0

* Deprecating ClassyEnum::Base#name (use to_s.titleize instead). `name` is
too ambiguous and might get confused with Ruby's Class.name method.

## 2.2.0

* Deprecating class names like ParentChild in favor of namespaced names
Expand All @@ -22,7 +27,7 @@

## 2.0.0

* Enum class definitions are no longer defined implicity and must be explicitly subclassed from children of ClassyEnum::Base
* Enum class definitions are no longer defined implicitly and must be explicitly subclassed from children of ClassyEnum::Base
* Formtastic support is not longer built-in. See https://github.com/beerlington/classy_enum/wiki/Formtastic-Support
* validates_uniqueness_of with an enum scope no longer works in Rails
3.0.x (no changes for Rails 3.1 or 3.2)
Expand Down
1 change: 1 addition & 0 deletions lib/classy_enum/instance_methods.rb
Expand Up @@ -57,6 +57,7 @@ def to_sym
# @priority = Priority.build(:really_high)
# @priority.name # => "Really High"
def name
ActiveSupport::Deprecation.warn('name is deprecated, and will be removed in ClassyEnum 3.0. Replace calls with to_s.titleize.', caller)
to_s.titleize
end

Expand Down

0 comments on commit af151e8

Please sign in to comment.