enumerize 2.8.0 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/enumerize/activerecord.rb +2 -0
- data/lib/enumerize/version.rb +1 -1
- data/test/activerecord_test.rb +10 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e8451ec4f75c5a22b6a9c6e337bece407942da5cb12f504b689582e56e1db55
|
4
|
+
data.tar.gz: cfd3f27f2fe811d1c23cf47e875da412b76efd0bae55d18f44d551eb56447507
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccc0ed4ca53517171dcac492ae9fd618c17fb08b9b39f4f42b6d951cdc46defb3acc92f66ce345fbe13cb0a654db8d7800b4dc72c19cb0c4e3c4ab1c3088780c
|
7
|
+
data.tar.gz: bd8521f6e55b9af3283073e36197ea5fc5107d4114f297713b6a27ac221bcd98f2376a4803351eeb8c1a7b518c032b6bcc5d16a6c7750294753d0f64f76a4352
|
data/CHANGELOG.md
CHANGED
data/lib/enumerize/version.rb
CHANGED
data/test/activerecord_test.rb
CHANGED
@@ -113,7 +113,7 @@ class User < ActiveRecord::Base
|
|
113
113
|
enumerize :sex, :in => [:male, :female], scope: :shallow
|
114
114
|
enumerize :language, :in => [:en, :jp]
|
115
115
|
|
116
|
-
serialize :interests, Array
|
116
|
+
serialize :interests, type: Array
|
117
117
|
enumerize :interests, :in => [:music, :sports, :dancing, :programming], :multiple => true
|
118
118
|
|
119
119
|
enumerize :status, :in => { active: 1, blocked: 2 }, scope: true
|
@@ -693,6 +693,15 @@ class ActiveRecordTest < Minitest::Spec
|
|
693
693
|
expect(user2.skill).must_equal 'casual'
|
694
694
|
end
|
695
695
|
|
696
|
+
it 'works when child class calls enumerize second time' do
|
697
|
+
class AdminUser < User
|
698
|
+
enumerize :account_type, in: [:basic, :premium, :pro]
|
699
|
+
end
|
700
|
+
|
701
|
+
admin = AdminUser.create(account_type: 'pro')
|
702
|
+
expect(admin.account_type).must_equal 'pro'
|
703
|
+
end
|
704
|
+
|
696
705
|
if Rails::VERSION::MAJOR >= 6
|
697
706
|
it 'supports AR#insert_all' do
|
698
707
|
User.delete_all
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumerize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Nartimov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.5.3
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: Enumerated attributes with I18n and ActiveRecord/Mongoid/MongoMapper support
|