classy_enum 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # ClassyEnum Changelog
2
2
 
3
+ ## 2.3.0
4
+
5
+ * Deprecating ClassyEnum::Base#name (use to_s.titleize instead). `name` is
6
+ too ambiguous and might get confused with Ruby's Class.name method.
7
+ * Deprecating :suffix option from classy_enum_attr (this was a temporary
8
+ hack)
9
+
3
10
  ## 2.2.0
4
11
 
5
12
  * Deprecating class names like ParentChild in favor of namespaced names
@@ -22,7 +29,7 @@
22
29
 
23
30
  ## 2.0.0
24
31
 
25
- * Enum class definitions are no longer defined implicity and must be explicitly subclassed from children of ClassyEnum::Base
32
+ * Enum class definitions are no longer defined implicitly and must be explicitly subclassed from children of ClassyEnum::Base
26
33
  * Formtastic support is not longer built-in. See https://github.com/beerlington/classy_enum/wiki/Formtastic-Support
27
34
  * validates_uniqueness_of with an enum scope no longer works in Rails
28
35
  3.0.x (no changes for Rails 3.1 or 3.2)
@@ -29,7 +29,11 @@ module ClassyEnum
29
29
  serialize_as_json = options[:serialize_as_json] || false
30
30
 
31
31
  reader_method = attribute.to_s
32
- reader_method += "_#{options[:suffix]}" if options.has_key?(:suffix)
32
+
33
+ if options.has_key? :suffix
34
+ ActiveSupport::Deprecation.warn(':suffix option for classy_enum_attr is deprecated, and will be removed in ClassyEnum 3.0.', caller)
35
+ reader_method += "_#{options[:suffix]}"
36
+ end
33
37
 
34
38
  klass = enum.to_s.camelize.constantize
35
39
 
@@ -57,6 +57,7 @@ module ClassyEnum
57
57
  # @priority = Priority.build(:really_high)
58
58
  # @priority.name # => "Really High"
59
59
  def name
60
+ ActiveSupport::Deprecation.warn('name is deprecated, and will be removed in ClassyEnum 3.0. Replace calls with to_s.titleize.', caller)
60
61
  to_s.titleize
61
62
  end
62
63
 
@@ -1,3 +1,3 @@
1
1
  module ClassyEnum
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classy_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-15 00:00:00.000000000 Z
12
+ date: 2012-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  segments:
123
123
  - 0
124
- hash: -1067969167030479994
124
+ hash: -2001790811310918278
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  none: false
127
127
  requirements:
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  segments:
132
132
  - 0
133
- hash: -1067969167030479994
133
+ hash: -2001790811310918278
134
134
  requirements: []
135
135
  rubyforge_project:
136
136
  rubygems_version: 1.8.24