Permalink
Browse files

Deprecating :suffix option from classy_enum_attr

  • Loading branch information...
1 parent db0e824 commit 2ad4f40cafc4df497048063c2907b51ebdfed8ba @beerlington beerlington committed Jul 20, 2012
Showing with 7 additions and 1 deletion.
  1. +2 −0 CHANGELOG.md
  2. +5 −1 lib/classy_enum/attributes.rb
View
@@ -4,6 +4,8 @@
* Deprecating ClassyEnum::Base#name (use to_s.titleize instead). `name` is
too ambiguous and might get confused with Ruby's Class.name method.
+* Deprecating :suffix option from classy_enum_attr (this was a temporary
+ hack)
## 2.2.0
@@ -29,7 +29,11 @@ def classy_enum_attr(*args)
serialize_as_json = options[:serialize_as_json] || false
reader_method = attribute.to_s
- reader_method += "_#{options[:suffix]}" if options.has_key?(:suffix)
+
+ if options.has_key? :suffix
+ ActiveSupport::Deprecation.warn(':suffix option for classy_enum_attr is deprecated, and will be removed in ClassyEnum 3.0.', caller)
+ reader_method += "_#{options[:suffix]}"
+ end
klass = enum.to_s.camelize.constantize

0 comments on commit 2ad4f40

Please sign in to comment.