unidom-dictionary 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f645a0cf5cafb36703dd4997386bfcbd1dc71a51
|
4
|
+
data.tar.gz: af612726989f68babfe9bf47740b132bf8457183
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5658add89e42c3ca5f1b1973b97aa9c8a39135ed6f7f48fcdabc94c5e01ef2cd3b1130b86fd9f0341fb9b845ebd6abc81d44ba7c791e59e5975f74aec34cc3f4
|
7
|
+
data.tar.gz: 2e77c7b3b251b7d8070bb83959d04e57df8d97201f7aa5bfff18b5ad5c04836d39e1f3a762e3dbf2e58cbdc6c89b31bc8d67bc56561d601e22cec46e0e8ffca9
|
data/README.md
CHANGED
@@ -39,10 +39,11 @@ The migration versions start with 200007.
|
|
39
39
|
# Dimensions of the Wellness
|
40
40
|
dictionary_code = 'WLNS'
|
41
41
|
attributes = { dictionary_code: dictionary_code, opened_at: Time.now }
|
42
|
-
occupational = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ value: 'Occupational' })
|
43
|
-
physical = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ value: 'Physical' })
|
44
|
-
social = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ value: 'Social' })
|
45
|
-
intellectual = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ value: 'Intellectual' })
|
46
|
-
spiritual = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ value: 'Spiritual' })
|
47
|
-
emotional = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ value: 'Emotional' })
|
42
|
+
occupational = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'OCPT', value: 'Occupational' })
|
43
|
+
physical = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'PHSC', value: 'Physical' })
|
44
|
+
social = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'SOCL', value: 'Social' })
|
45
|
+
intellectual = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'INTL', value: 'Intellectual' })
|
46
|
+
spiritual = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'SPRT', value: 'Spiritual' })
|
47
|
+
emotional = Unidom::Dictionary::DictionaryItem.create! attributes.merge({ code: 'EMTN', value: 'Emotional' })
|
48
|
+
# The #code attribtue could be nil.
|
48
49
|
```
|
@@ -6,6 +6,7 @@ class Unidom::Dictionary::DictionaryItem < Unidom::Dictionary::ApplicationRecord
|
|
6
6
|
|
7
7
|
include Unidom::Common::Concerns::ModelExtension
|
8
8
|
|
9
|
-
validates :
|
9
|
+
validates :code, allow_blank: true, length: { in: 1..self.columns_hash['code'].limit }
|
10
|
+
validates :value, presence: true, length: { in: 2..self.columns_hash['value'].limit }
|
10
11
|
|
11
12
|
end
|
@@ -5,6 +5,7 @@ class CreateUnidomDictionaryItems < ActiveRecord::Migration
|
|
5
5
|
create_table :unidom_dictionary_items, id: :uuid do |t|
|
6
6
|
|
7
7
|
t.column :dictionary_code, 'char(4)', null: false, default: 'C'
|
8
|
+
t.string :code, null: true, default: nil, limit: 64
|
8
9
|
|
9
10
|
t.string :value, null: false, default: '', limit: 200
|
10
11
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-dictionary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|