Permalink
Browse files

Deprecating ClassyEnum::Base#name

Method name is too ambiguous and says nothing about what it actually did
  • Loading branch information...
1 parent c070b24 commit af151e8b84ee5dc0e2b4424be1f6a06124ede3b0 @beerlington beerlington committed Jul 20, 2012
Showing with 7 additions and 1 deletion.
  1. +6 −1 CHANGELOG.md
  2. +1 −0 lib/classy_enum/instance_methods.rb
View
@@ -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
@@ -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)
@@ -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

0 comments on commit af151e8

Please sign in to comment.