careacademy-enumerize 2.8.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.
- checksums.yaml +7 -0
- data/.github/workflows/ruby.yml +69 -0
- data/.gitignore +23 -0
- data/.rspec +2 -0
- data/CHANGELOG.md +327 -0
- data/Gemfile +6 -0
- data/Gemfile.global +12 -0
- data/Gemfile.mongo_mapper +6 -0
- data/Gemfile.rails60 +6 -0
- data/Gemfile.rails61 +6 -0
- data/Gemfile.rails70 +9 -0
- data/Gemfile.railsmaster +5 -0
- data/MIT-LICENSE +22 -0
- data/README.md +641 -0
- data/Rakefile +17 -0
- data/enumerize.gemspec +22 -0
- data/lib/enumerize/activemodel.rb +47 -0
- data/lib/enumerize/activerecord.rb +142 -0
- data/lib/enumerize/attribute.rb +192 -0
- data/lib/enumerize/attribute_map.rb +40 -0
- data/lib/enumerize/base.rb +112 -0
- data/lib/enumerize/hooks/formtastic.rb +27 -0
- data/lib/enumerize/hooks/sequel_dataset.rb +17 -0
- data/lib/enumerize/hooks/simple_form.rb +37 -0
- data/lib/enumerize/hooks/uniqueness.rb +22 -0
- data/lib/enumerize/integrations/rails_admin.rb +18 -0
- data/lib/enumerize/integrations/rspec/matcher.rb +164 -0
- data/lib/enumerize/integrations/rspec.rb +19 -0
- data/lib/enumerize/module.rb +33 -0
- data/lib/enumerize/module_attributes.rb +12 -0
- data/lib/enumerize/mongoid.rb +29 -0
- data/lib/enumerize/predicatable.rb +23 -0
- data/lib/enumerize/predicates.rb +76 -0
- data/lib/enumerize/scope/activerecord.rb +53 -0
- data/lib/enumerize/scope/mongoid.rb +50 -0
- data/lib/enumerize/scope/sequel.rb +56 -0
- data/lib/enumerize/sequel.rb +62 -0
- data/lib/enumerize/set.rb +81 -0
- data/lib/enumerize/utils.rb +12 -0
- data/lib/enumerize/value.rb +47 -0
- data/lib/enumerize/version.rb +5 -0
- data/lib/enumerize.rb +90 -0
- data/lib/sequel/plugins/enumerize.rb +18 -0
- data/spec/enumerize/integrations/rspec/matcher_spec.rb +261 -0
- data/spec/spec_helper.rb +30 -0
- data/test/activemodel_test.rb +114 -0
- data/test/activerecord_test.rb +679 -0
- data/test/attribute_map_test.rb +70 -0
- data/test/attribute_test.rb +141 -0
- data/test/base_test.rb +230 -0
- data/test/formtastic_test.rb +152 -0
- data/test/module_attributes_test.rb +52 -0
- data/test/mongo_mapper_test.rb +83 -0
- data/test/mongoid_test.rb +164 -0
- data/test/multiple_test.rb +65 -0
- data/test/predicates_test.rb +65 -0
- data/test/rails_admin_test.rb +27 -0
- data/test/sequel_test.rb +344 -0
- data/test/set_test.rb +166 -0
- data/test/simple_form_test.rb +156 -0
- data/test/support/mock_controller.rb +31 -0
- data/test/support/shared_enums.rb +43 -0
- data/test/support/view_test_helper.rb +46 -0
- data/test/test_helper.rb +53 -0
- data/test/value_test.rb +158 -0
- metadata +143 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 39998911c97eb9c92438b79c9193a84eb7d49ad929cbedc5b907026b3dca2e8e
|
4
|
+
data.tar.gz: 456c69fffae8409f2338b7165172abe0737f7d52b1eb1ac65aeb0bc60a351abf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 888453d724dd81f98056afcfea9a0f9a9728432e0271fd4500561be7d9af71d28a017156a50787d40fa77109e915a4881c2fe57a0b23ade38a92a60f23a5e83d
|
7
|
+
data.tar.gz: d507e1d66c868149b353ed98fb392b64a96b8b35e1d31132074387508874fe7c6da233eed522b40a9a7459fefc0ca1d008c503bb04976d169e800b1e0cf6e1e3
|
@@ -0,0 +1,69 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-20.04
|
12
|
+
services:
|
13
|
+
mongodb:
|
14
|
+
image: mongo:latest
|
15
|
+
ports:
|
16
|
+
- 27017:27017
|
17
|
+
postgres:
|
18
|
+
image: postgres:12
|
19
|
+
env:
|
20
|
+
POSTGRES_USER: postgres
|
21
|
+
POSTGRES_PASSWORD: postgres
|
22
|
+
ports:
|
23
|
+
- 5432:5432
|
24
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
25
|
+
mysql:
|
26
|
+
image: mysql:5.6
|
27
|
+
env:
|
28
|
+
MYSQL_ROOT_PASSWORD: mysql
|
29
|
+
ports:
|
30
|
+
- 3306:3306
|
31
|
+
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
ruby-version: ['2.7', '3.0.2']
|
36
|
+
gemfile:
|
37
|
+
- Gemfile
|
38
|
+
- Gemfile.rails60
|
39
|
+
- Gemfile.rails61
|
40
|
+
- Gemfile.rails70
|
41
|
+
- Gemfile.railsmaster
|
42
|
+
- Gemfile.mongo_mapper
|
43
|
+
db:
|
44
|
+
- sqlite3
|
45
|
+
- postgresql
|
46
|
+
- mysql2
|
47
|
+
exclude:
|
48
|
+
- gemfile: Gemfile.mongo_mapper
|
49
|
+
db: postgresql
|
50
|
+
- ruby-version: '3.0.2'
|
51
|
+
gemfile: Gemfile
|
52
|
+
- ruby-version: '3.0.2'
|
53
|
+
gemfile: Gemfile.mongo_mapper
|
54
|
+
env:
|
55
|
+
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
56
|
+
DB: "${{ matrix.db }}"
|
57
|
+
steps:
|
58
|
+
- uses: actions/checkout@v2
|
59
|
+
- name: Set up Ruby
|
60
|
+
uses: ruby/setup-ruby@v1
|
61
|
+
with:
|
62
|
+
ruby-version: ${{ matrix.ruby-version }}
|
63
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
64
|
+
- name: Run tests
|
65
|
+
run: bundle exec rake
|
66
|
+
env:
|
67
|
+
POSTGRES_USER: postgres
|
68
|
+
POSTGRES_PASSWORD: postgres
|
69
|
+
MYSQL_ROOT_PASSWORD: mysql
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.ruby-version
|
6
|
+
.yardoc
|
7
|
+
.idea/
|
8
|
+
enumerize.iml
|
9
|
+
Gemfile*.lock
|
10
|
+
gemfiles/Gemfile-*.lock
|
11
|
+
InstalledFiles
|
12
|
+
_yardoc
|
13
|
+
coverage
|
14
|
+
doc/
|
15
|
+
lib/bundler/man
|
16
|
+
log/*
|
17
|
+
pkg
|
18
|
+
rdoc
|
19
|
+
spec/reports
|
20
|
+
test/tmp
|
21
|
+
test/version_tmp
|
22
|
+
tmp
|
23
|
+
vendor/bundle
|
data/.rspec
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,327 @@
|
|
1
|
+
## master
|
2
|
+
|
3
|
+
### enhancements
|
4
|
+
|
5
|
+
* Allow usage of kwargs with inheritance in Ruby 3.x. Support only Ruby 2.7+. (by [@mortik](https://github.com/mortik))
|
6
|
+
|
7
|
+
## 2.5.0 (December 24, 2021)
|
8
|
+
|
9
|
+
### enhancements
|
10
|
+
|
11
|
+
* Add support for Rails 7.0.0.alpha. (by [@f-mer](https://github.com/f-mer))
|
12
|
+
* Add support for negative shallow scopes. (by [@nashby](https://github.com/nashby))
|
13
|
+
|
14
|
+
## 2.4.0 (December 12, 2020)
|
15
|
+
|
16
|
+
### enhancements
|
17
|
+
|
18
|
+
* Show warning when enumerized value name conflicts with existing object's methods. (by [@aki77](https://github.com/aki77))
|
19
|
+
* Add RSpec support for shallow scopes. (by [@nashby](https://github.com/nashby))
|
20
|
+
* Drop support for Ruby older than 2.5. Support only Ruby 2.5+. (by [@nashby](https://github.com/nashby))
|
21
|
+
* Drop support for Rails 4. Support only Rails 5.2+. (by [@nashby](https://github.com/nashby))
|
22
|
+
* Add support for Rails 6.1 (by [@y-yagi](https://github.com/y-yagi))
|
23
|
+
|
24
|
+
### bug fix
|
25
|
+
|
26
|
+
* Fix exception when using predicate methods on enumerized value transformed into invalid value. (by [@guigs](https://github.com/guigs))
|
27
|
+
* Fix issue with RSpec#with_predicates matcher when custom values are used as attribute. (by [@nashby](https://github.com/nashby))
|
28
|
+
|
29
|
+
## 2.3.1 (May 2, 2019)
|
30
|
+
|
31
|
+
### enhancements
|
32
|
+
|
33
|
+
* Add ability to skip validations by passing `:skip_validations` option. (by [@chumakoff](https://github.com/chumakoff))
|
34
|
+
* Add option `scope: shallow` to extend scopes based on enumerized attribute values (by [@moofkit](https://github.com/moofkit/))
|
35
|
+
|
36
|
+
### bug fix
|
37
|
+
|
38
|
+
* Fix issue with ActiveRecord and Mongoid `reload` method when enumberized attributes weren't synced from DB. (by [@nashby](https://github.com/nashby) and [@FunkyloverOne](https://github.com/FunkyloverOne))
|
39
|
+
* Fix issue with ActiveRecord `reload` method not working for ActiveRecord::Store attributes due to `1b776c`. (by [@rickcsong](https://github.com/rickcsong))
|
40
|
+
|
41
|
+
## 2.2.2 (March 6, 2018)
|
42
|
+
|
43
|
+
### bug fix
|
44
|
+
|
45
|
+
* Support non-ActiveModel objects in SimpleForm/Formtastic integration. (by [@nashby](https://github.com/nashby))
|
46
|
+
|
47
|
+
## 2.2.1 (February 15, 2018)
|
48
|
+
|
49
|
+
### bug fix
|
50
|
+
|
51
|
+
* Fix issue with SimpleForm/Formtastic forms without object. (by [@nashby](https://github.com/nashby))
|
52
|
+
|
53
|
+
## 2.2.0 (February 13, 2018)
|
54
|
+
|
55
|
+
### enhancements
|
56
|
+
|
57
|
+
* Add integration with active_interaction. (by [@runephilosof](https://github.com/runephilosof))
|
58
|
+
* Allow using `plugin :enumerize` with Sequel. (by [@jnylen](https://github.com/jnylen))
|
59
|
+
* Support ActiveModel::Attributes from Rails 5.2. (by [@troter](https://github.com/troter))
|
60
|
+
* Support Sequel 5.2.0. (by [@troter](https://github.com/troter))
|
61
|
+
|
62
|
+
### bug fix
|
63
|
+
|
64
|
+
* Fix RailsAdmin integration when enumerated field used on edit form and enumerated value wasn't set. (by [@nashby](https://github.com/nashby))
|
65
|
+
* Fallback to a raw passed value instead of nil if AR type can't find value in the attribute. (by [@nashby](https://github.com/nashby))
|
66
|
+
|
67
|
+
## 2.1.2 (May 18, 2017)
|
68
|
+
|
69
|
+
### bug fix
|
70
|
+
|
71
|
+
* Support YAML serialization for the custom AR type. (by [@lest](https://github.com/lest))
|
72
|
+
|
73
|
+
## 2.1.1 (May 1, 2017)
|
74
|
+
|
75
|
+
### enhancements
|
76
|
+
|
77
|
+
* Run tests with multiple DBs (SQLite and PostgreSQL). (by [tkawa](https://github.com/tkawa))
|
78
|
+
|
79
|
+
### bug fix
|
80
|
+
|
81
|
+
* Support deserialize and Rails 4.2 methods in the custom AR::Type class. (by [@lest](https://github.com/lest))
|
82
|
+
* Support dumping custom AR type to JSON. (by [@lest](https://github.com/lest))
|
83
|
+
|
84
|
+
## 2.1.0 (March 31, 2017)
|
85
|
+
|
86
|
+
### enhancements
|
87
|
+
|
88
|
+
* Support Active Record types serialization. (by [@lest](https://github.com/lest))
|
89
|
+
|
90
|
+
## 2.0.1 (October 18, 2016)
|
91
|
+
|
92
|
+
### bug fix
|
93
|
+
|
94
|
+
* Support enumerized attributes in #update_all on relation objects. (by [@lest](https://github.com/lest))
|
95
|
+
|
96
|
+
## 2.0.0 (August 10, 2016)
|
97
|
+
|
98
|
+
### enhancements
|
99
|
+
|
100
|
+
* Drop support for Ruby older than 2.2. Support only Ruby 2.2+. (by [@nashby](https://github.com/nashby))
|
101
|
+
* Drop support for Rails 4.0 and 4.1. Support only Rails 4.2 and newer. (by [@lest](https://github.com/lest))
|
102
|
+
* Support Rails 5.0. (by [@nashby](https://github.com/nashby) and [@lest](https://github.com/lest))
|
103
|
+
* Allow to pass enumerize values to `ActiveRecord#update_all` (by [@DmitryTsepelev](https://github.com/DmitryTsepelev) and [@ianwhite](https://github.com/ianwhite))
|
104
|
+
|
105
|
+
```ruby
|
106
|
+
User.update_all(status: :blocked)
|
107
|
+
```
|
108
|
+
|
109
|
+
### bug fix
|
110
|
+
|
111
|
+
* Rescue MissingAttributeError on attribute writing. (by [@embs](https://github.com/embs))
|
112
|
+
* Fix presence validation for multiple attributes when the list contains a blank string. (by [@smoriwaki](https://github.com/smoriwaki))
|
113
|
+
* Replace deprecated alias_method_chain with Module#prepend. (by [@koenpunt](https://github.com/koenpunt) and [@akm](https://github.com/akm))
|
114
|
+
* Make it compatible with `globalize` gem. (by [@falm](https://github.com/falm))
|
115
|
+
* Prevent method getter from being called when no default_value is being set. (by [@arjan0307](https://github.com/arjan0307))
|
116
|
+
|
117
|
+
## 1.1.1 (January 25, 2016)
|
118
|
+
|
119
|
+
### bug fix
|
120
|
+
|
121
|
+
* Fix exception when using predicate methods and enumerized values have dash in it. (by [@nashby](https://github.com/nashby))
|
122
|
+
|
123
|
+
## 1.1.0 (November 15, 2015)
|
124
|
+
|
125
|
+
### enhancements
|
126
|
+
* Add Sequel support. (by [@mrbrdo](https://github.com/mrbrdo))
|
127
|
+
* Add qualifiers to RSpec matcher. (by [@maurogeorge](https://github.com/maurogeorge))
|
128
|
+
* Support hash in the RSpec matcher. (by [@maurogeorge](https://github.com/maurogeorge))
|
129
|
+
|
130
|
+
### bug fix
|
131
|
+
|
132
|
+
## 1.0.0 (August 2, 2015)
|
133
|
+
|
134
|
+
### enhancements
|
135
|
+
* Add `texts` method for getting an array of text values of the enumerized field with multiple type. (by [@huynhquancam](https://github.com/huynhquancam))
|
136
|
+
* Drop Rails 3.2 support. (by [@nashby](https://github.com/nashby))
|
137
|
+
|
138
|
+
### bug fix
|
139
|
+
|
140
|
+
* Fix conflicts when Active Record and Mongoid are used at the same time. (by [@matsu911](https://github.com/matsu911))
|
141
|
+
|
142
|
+
## 0.11.0 (March 29, 2015) ##
|
143
|
+
|
144
|
+
### enhancements
|
145
|
+
* Add ability to set default value for enumerized field with multiple type. (by [@nashby](https://github.com/nashby))
|
146
|
+
* Support Rails 4.2. (by [@lest](https://github.com/lest))
|
147
|
+
|
148
|
+
### bug fix
|
149
|
+
* Use Mongoid's `:in` method for generated scopes, fix chained scopes. (by [@nashby](https://github.com/nashby))
|
150
|
+
* Use `after_initialize` callback to set default value in Mongoid documents. (by [@nashby](https://github.com/nashby))
|
151
|
+
|
152
|
+
## 0.10.1 (March 4, 2015) ##
|
153
|
+
|
154
|
+
### bug fix
|
155
|
+
|
156
|
+
* Use method_missing instead of defining singleton class methods to allow Marshal serialization (by [@lest](https://github.com/lest))
|
157
|
+
|
158
|
+
## 0.10.0 (February 17, 2015) ##
|
159
|
+
|
160
|
+
### enhancements
|
161
|
+
|
162
|
+
* Add scopes support to mongoid documents (by [@nashby](https://github.com/nashby))
|
163
|
+
* Use underscore.humanize in #text to make use of Inflector acronyms (by [@mintuhouse](https://github.com/mintuhouse))
|
164
|
+
* Raise an exception when :scope option is used together with :multiple option (by [@maurogeorge](https://github.com/maurogeorge))
|
165
|
+
* Use alias_method_chain instead of overriding Class#inherited (by [@yuroyoro](https://github.com/yuroyoro))
|
166
|
+
* Shortcut methods to retrieve enumerize values (by [@CyborgMaster](https://github.com/CyborgMaster))
|
167
|
+
* Extend equality operator to support comparing with symbols and custom values (e.g. integers) (by [@CyborgMaster](https://github.com/CyborgMaster))
|
168
|
+
|
169
|
+
## 0.9.0 (December 11, 2014) ##
|
170
|
+
|
171
|
+
### enhancements
|
172
|
+
|
173
|
+
* Add :value_class option (by [@lest](https://github.com/lest))
|
174
|
+
* Use 'defaults' scope in the localization file for the attributes that used across several models. This will help to avoid conflicting keys with model names and attribute names. Example:
|
175
|
+
|
176
|
+
```yml
|
177
|
+
en:
|
178
|
+
enumerize:
|
179
|
+
defaults:
|
180
|
+
sex:
|
181
|
+
male: Male
|
182
|
+
female: Female
|
183
|
+
```
|
184
|
+
|
185
|
+
You still can use the old solution without "default" scope:
|
186
|
+
|
187
|
+
```yml
|
188
|
+
en:
|
189
|
+
enumerize:
|
190
|
+
sex:
|
191
|
+
male: Male
|
192
|
+
female: Female
|
193
|
+
```
|
194
|
+
(by [@nashby](https://github.com/nashby))
|
195
|
+
|
196
|
+
### bug fix
|
197
|
+
* Store values for validation using string keys (by [@nagyt234](https://github.com/nagyt234))
|
198
|
+
* Store custom values for multiple attributes (by [@lest](https://github.com/lest))
|
199
|
+
* Support validations after using AR#becomes (by [@lest](https://github.com/lest))
|
200
|
+
* Do not try to set attribute for not selected attributes (by [@dany1468](https://github.com/dany1468))
|
201
|
+
|
202
|
+
## 0.8.0 (March 4, 2014) ##
|
203
|
+
|
204
|
+
### enhancements
|
205
|
+
* Integration with SimpleForm's `input_field` (by [@nashby](https://github.com/nashby))
|
206
|
+
* Support multiple attributes in Active Record #becomes method (by [@lest](https://github.com/lest))
|
207
|
+
* Add ability to specify localization scope with `i18n_scope` option (by [@dreamfall](https://github.com/dreamfall))
|
208
|
+
|
209
|
+
### bug fix
|
210
|
+
* Fix Rails Admin integration when custom values are used (by [@brenes](https://github.com/brenes))
|
211
|
+
* Fix RSpec integration using enumerize with Spring (by [@winston](https://github.com/winston))
|
212
|
+
* Return proper RSpec failure message for enumerized attribute with default value (by [@nashby](https://github.com/nashby))
|
213
|
+
* Return proper RSpec description for enumerized attribute without default value (by [@andreygerasimchuk](https://github.com/andreygerasimchuk))
|
214
|
+
* Do not try to set default value for not selected attributes (by [@nashby](https://github.com/nashby))
|
215
|
+
* Fix uniqueness validation with Active Record (by [@lest](https://github.com/lest))
|
216
|
+
* Fix loading of attributes with multiple: true in mongoid (by [glebtv](https://github.com/glebtv))
|
217
|
+
* Serialize value as scalar type (by [@ka8725](https://github.com/ka8725))
|
218
|
+
|
219
|
+
## 0.7.0 (August 21, 2013) ##
|
220
|
+
|
221
|
+
### enhancements
|
222
|
+
* Give priority to model specific translation definition. See example [here](https://github.com/brainspec/enumerize/pull/96) (by [@labocho](https://github.com/labocho))
|
223
|
+
* Allow lambda in default value (by [@adie](https://github.com/adie))
|
224
|
+
* Add predicate methods to the multiple attributes (by [@nashby](https://github.com/nashby))
|
225
|
+
* Add RSpec matcher (by [@nashby](https://github.com/nashby))
|
226
|
+
* Add `*_value` method that returns actual value of the enumerized attribute (useful for attributes with custom values)
|
227
|
+
(by [@tkyowa](https://github.com/tkyowa))
|
228
|
+
|
229
|
+
### bug fix
|
230
|
+
* Make validation work when `write_attribute` is using for setting enumerized values (by [@nashby](https://github.com/nashby))
|
231
|
+
* Validates enumerized values when enumeration is included via module
|
232
|
+
(by [@nashby](https://github.com/nashby)) and (by [@lest](https://github.com/lest))
|
233
|
+
|
234
|
+
## 0.6.1 (May 20, 2013) ##
|
235
|
+
|
236
|
+
### bug fix
|
237
|
+
* Don't raise error when enumerized attribute is already defined. (by [@lest](https://github.com/lest))
|
238
|
+
|
239
|
+
## 0.6.0 (May 16, 2013) ##
|
240
|
+
|
241
|
+
### enhancements
|
242
|
+
* Use inclusion error message for invalid values (by [@lest](https://github.com/lest))
|
243
|
+
* Add `:only` and `except` options to the `Attribute#options` method. (by [@thehappycoder](https://github.com/thehappycoder) and [@randoum](https://github.com/randoum))
|
244
|
+
* ActiveRecord scopes. (by [@lest](https://github.com/lest), [@banyan](https://github.com/banyan) and [@nashby](https://github.com/nashby))
|
245
|
+
* Support for RailsAdmin (by [@drewda](https://github.com/drewda))
|
246
|
+
|
247
|
+
### bug fix
|
248
|
+
* Return correct default value for enumerized attribute using `default_scope` with generated scope [@nashby](https://github.com/nashby)
|
249
|
+
* Allow either key or value as valid (by [aghull](https://github.com/aghull) and [@lest](https://github.com/lest))
|
250
|
+
* Use default enum value from db column (by [@lest](https://github.com/lest))
|
251
|
+
|
252
|
+
## 0.5.1 (December 10, 2012) ##
|
253
|
+
|
254
|
+
### bug fix
|
255
|
+
|
256
|
+
* Always return Enumerize::Set for multiple attributes (by [@nashby](https://github.com/nashby))
|
257
|
+
|
258
|
+
## 0.5.0 (October 31, 2012) ##
|
259
|
+
|
260
|
+
The previous method of adding enumerize to a class was deprecated. Please use
|
261
|
+
`extend Enumerize` instead of `include Enumerize`.
|
262
|
+
|
263
|
+
### enhancements
|
264
|
+
* SimpleForm support for multiple attributes. (by [@nashby](https://github.com/nashby))
|
265
|
+
* Formtastic support for multiple attributes. (by [@nashby](https://github.com/nashby))
|
266
|
+
* Array-like multiple attributes. (by [@lest](https://github.com/lest))
|
267
|
+
|
268
|
+
## 0.4.0 (September 6, 2012) ##
|
269
|
+
|
270
|
+
Legacy support was dropped. The following versions are supported:
|
271
|
+
|
272
|
+
* Ruby 1.9.3+ (including JRuby and Rubinius)
|
273
|
+
* Rails 3.2+
|
274
|
+
* Formtastic 2.2+
|
275
|
+
* SimpleForm 2+
|
276
|
+
* Mongoid 3+
|
277
|
+
|
278
|
+
### enhancements
|
279
|
+
* Ability to define predicate methods on enumerized object. (by [@lest](https://github.com/lest))
|
280
|
+
|
281
|
+
## 0.3.0 (July 9, 2012) ##
|
282
|
+
|
283
|
+
### enhancements
|
284
|
+
* Accept a values hash to store an attribute using custom values (e.g. integers) (by [@lest](https://github.com/lest))
|
285
|
+
|
286
|
+
## 0.2.2 (May 22, 2012) ##
|
287
|
+
|
288
|
+
### bug fix
|
289
|
+
* Correctly assign default value to handle mass assignment in Active Record (by [@lest](https://github.com/lest))
|
290
|
+
|
291
|
+
## 0.2.1 (May 21, 2012) ##
|
292
|
+
|
293
|
+
### bug fix
|
294
|
+
* Call super in attribute accessors if available (by [@lest](https://github.com/lest))
|
295
|
+
|
296
|
+
## 0.2.0 (March 29, 2012) ##
|
297
|
+
|
298
|
+
### enhancements
|
299
|
+
* Ability to enumerize attributes in a module and then include it into classes (by [@lest](https://github.com/lest))
|
300
|
+
* Add error to a model when attribute value is not included in allowed list (by [@lest](https://github.com/lest))
|
301
|
+
|
302
|
+
### bug fix
|
303
|
+
* Inheriting enumerized attributes (by [@cgunther](https://github.com/cgunther) and [@nashby](https://github.com/nashby))
|
304
|
+
* Don't cast nil to string (by [@jimryan](https://github.com/jimryan))
|
305
|
+
|
306
|
+
## 0.1.1 (March 6, 2012) ##
|
307
|
+
|
308
|
+
### bug fix
|
309
|
+
* I18n regression: Multiple calls to value #text return different results (by [@cgunther](https://github.com/cgunther) and [@lest](https://github.com/lest))
|
310
|
+
|
311
|
+
## 0.1.0 (March 5, 2012) ##
|
312
|
+
|
313
|
+
### enhancements
|
314
|
+
* Return humanized value if there are no translations (by [@nashby](https://github.com/nashby))
|
315
|
+
* Integration with SimpleForm (by [@nashby](https://github.com/nashby))
|
316
|
+
* Integration with Formtastic (by [@lest](https://github.com/lest))
|
317
|
+
|
318
|
+
## 0.0.4 (February 8, 2012) ##
|
319
|
+
|
320
|
+
### bug fix
|
321
|
+
* Make attribute accessors to work with ActiveRecord 3.1.x (by [@lest](https://github.com/lest))
|
322
|
+
|
323
|
+
## 0.0.3 (February 8, 2012) ##
|
324
|
+
|
325
|
+
### enhancements
|
326
|
+
* Mongoid support (by [@lest](https://github.com/lest))
|
327
|
+
* Boolean methods (by [@Dreamfa11](https://github.com/Dreamfa11))
|
data/Gemfile
ADDED
data/Gemfile.global
ADDED
data/Gemfile.rails60
ADDED
data/Gemfile.rails61
ADDED
data/Gemfile.rails70
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
eval_gemfile('Gemfile.global')
|
2
|
+
|
3
|
+
gem 'minitest', '~> 5.8'
|
4
|
+
gem 'rails', github: 'rails/rails', branch: '7-0-stable', require: false
|
5
|
+
|
6
|
+
# TODO: Mongoid doesn't support Rails 7 yet. Uncomment when it's fixed https://jira.mongodb.org/browse/MONGOID-5193
|
7
|
+
# gem 'mongoid', github: 'mongodb/mongoid'
|
8
|
+
|
9
|
+
gem 'sqlite3', :platform => [:ruby, :mswin, :mingw]
|
data/Gemfile.railsmaster
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Brainspec
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|