classy_enum 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # classy_enum
1
+ # ClassyEnum
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/beerlington/classy_enum.png?branch=master)](http://travis-ci.org/beerlington/classy_enum)
4
4
 
@@ -55,4 +55,6 @@ module ClassyEnum
55
55
  end
56
56
  end
57
57
 
58
- ActiveRecord::Base.send :extend, ClassyEnum::ActiveRecord
58
+ if defined?(ActiveRecord::Base)
59
+ ActiveRecord::Base.send :extend, ClassyEnum::ActiveRecord
60
+ end
@@ -25,8 +25,10 @@ module ClassyEnum
25
25
  # This is due to a bug in Rails where it uses the method result as opposed to the
26
26
  # database value for validation scopes. A fix will be released in Rails 4, but
27
27
  # this will remain until Rails 3.x is no longer prevalent.
28
- Arel::Visitors::ToSql.class_eval do
29
- define_method "visit_#{klass.name.split('::').join('_')}", lambda {|value| quote(value.to_s) }
28
+ if defined?(Arel::Visitors::ToSql)
29
+ Arel::Visitors::ToSql.class_eval do
30
+ define_method "visit_#{klass.name.split('::').join('_')}", lambda {|value| quote(value.to_s) }
31
+ end
30
32
  end
31
33
 
32
34
  # Convert from MyEnumClass::NumberTwo to :number_two
@@ -1,3 +1,3 @@
1
1
  module ClassyEnum
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
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: 3.0.0
4
+ version: 3.0.1
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-20 00:00:00.000000000 Z
12
+ date: 2012-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  segments:
126
126
  - 0
127
- hash: 3644506881692123531
127
+ hash: 4077796099842311388
128
128
  required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  segments:
135
135
  - 0
136
- hash: 3644506881692123531
136
+ hash: 4077796099842311388
137
137
  requirements: []
138
138
  rubyforge_project:
139
139
  rubygems_version: 1.8.24