simple_enum 1.3.0 → 1.3.1
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/Gemfile.BACKPORT +2 -2
- data/Gemfile.BACKPORT.lock +5 -5
- data/README.rdoc +1 -0
- data/lib/simple_enum.rb +4 -2
- data/test/test_helper.rb +5 -0
- metadata +4 -4
data/Gemfile.BACKPORT
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
source :rubygems
|
2
2
|
|
3
|
-
gem "activesupport", "
|
4
|
-
gem "activerecord", "
|
3
|
+
gem "activesupport", "2.3.5", :require => "active_support"
|
4
|
+
gem "activerecord", "2.3.5", :require => "active_record"
|
5
5
|
|
6
6
|
gem "sqlite3-ruby", :require => "sqlite3", :platforms => :ruby
|
7
7
|
gem "jdbc-sqlite3", :require => "jdbcsqlite3", :platforms => :jruby
|
data/Gemfile.BACKPORT.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activerecord (2.3.
|
5
|
-
activesupport (= 2.3.
|
6
|
-
activesupport (2.3.
|
4
|
+
activerecord (2.3.5)
|
5
|
+
activesupport (= 2.3.5)
|
6
|
+
activesupport (2.3.5)
|
7
7
|
sqlite3-ruby (1.3.2)
|
8
8
|
|
9
9
|
PLATFORMS
|
10
10
|
ruby
|
11
11
|
|
12
12
|
DEPENDENCIES
|
13
|
-
activerecord (
|
14
|
-
activesupport (
|
13
|
+
activerecord (= 2.3.5)
|
14
|
+
activesupport (= 2.3.5)
|
15
15
|
jdbc-sqlite3
|
16
16
|
sqlite3-ruby
|
data/README.rdoc
CHANGED
@@ -186,6 +186,7 @@ or <em>b)</em> a custom method to convert an object to a symbolized form named +
|
|
186
186
|
|
187
187
|
* dmitry - bugfixes and other improvements
|
188
188
|
* tarsolya - implemented all the ruby 1.9 and rails 3 goodness!
|
189
|
+
* dbalatero - rails 2.3.5 bugfix
|
189
190
|
|
190
191
|
== Licence & Copyright
|
191
192
|
Copyright (c) 2009 by Lukas Westermann, Licenced under MIT Licence (see LICENCE file)
|
data/lib/simple_enum.rb
CHANGED
@@ -21,7 +21,7 @@ require 'simple_enum/validation'
|
|
21
21
|
module SimpleEnum
|
22
22
|
|
23
23
|
# +SimpleEnum+ version string.
|
24
|
-
VERSION = "1.3.
|
24
|
+
VERSION = "1.3.1".freeze
|
25
25
|
|
26
26
|
class << self
|
27
27
|
|
@@ -153,6 +153,8 @@ module SimpleEnum
|
|
153
153
|
def as_enum(enum_cd, values, options = {})
|
154
154
|
options = SimpleEnum.default_options.merge({ :column => "#{enum_cd}_cd" }).merge(options)
|
155
155
|
options.assert_valid_keys(:column, :whiny, :prefix, :slim, :upcase)
|
156
|
+
|
157
|
+
metaclass = (class << self; self; end)
|
156
158
|
|
157
159
|
# convert array to hash...
|
158
160
|
values = SimpleEnum::EnumHash.new(values)
|
@@ -213,7 +215,7 @@ module SimpleEnum
|
|
213
215
|
|
214
216
|
# allow class access to each value
|
215
217
|
unless options[:slim] === :class
|
216
|
-
|
218
|
+
metaclass.send(:define_method, "#{prefix}#{sym}", Proc.new { |*args| args.first ? k : code })
|
217
219
|
end
|
218
220
|
end
|
219
221
|
end
|
data/test/test_helper.rb
CHANGED
@@ -9,6 +9,8 @@ require 'bundler/setup'
|
|
9
9
|
require 'test/unit'
|
10
10
|
require 'active_support'
|
11
11
|
require 'active_record'
|
12
|
+
require 'active_support/version'
|
13
|
+
require 'active_record/version'
|
12
14
|
|
13
15
|
# setup fake rails env
|
14
16
|
ROOT = File.join(File.dirname(__FILE__), '..')
|
@@ -26,6 +28,9 @@ require File.join(ROOT, 'init')
|
|
26
28
|
# load dummy class
|
27
29
|
require File.join(ROOT, 'test', 'models')
|
28
30
|
|
31
|
+
# Test environment info
|
32
|
+
puts "Testing against: activesupport-#{ActiveSupport::VERSION::STRING}, activerecord-#{ActiveRecord::VERSION::STRING}"
|
33
|
+
|
29
34
|
# Reload database
|
30
35
|
def reload_db(options = {})
|
31
36
|
options = { :fill => true, :genders => false }.merge(options)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 1
|
10
|
+
version: 1.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lukas Westermann
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-10 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|