unidom-dictionary 0.1 → 0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e159783eeaaaeb3ba56da57fa717a1f3dc8c5c57
4
- data.tar.gz: 819abbffe6385a30af7060795f3a25c8aea8e5e9
3
+ metadata.gz: f645a0cf5cafb36703dd4997386bfcbd1dc71a51
4
+ data.tar.gz: af612726989f68babfe9bf47740b132bf8457183
5
5
  SHA512:
6
- metadata.gz: d328474655710066839d7409aaf7ef6941cac02269828ecca43d6d882550b41f6b3e783a39e67d8140cbddefdd93c458288f6bc83e1e453a26bd1be17e34067a
7
- data.tar.gz: 9c4521e28bc72590a2e534a65c431c1e25bb66897e871ac7627089a8a119658bf55ca6229be8e2a9d87c4fe496a2f37cc054a6faad6bca9d54fbb1dafdd57ebc
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 :value, presence: true, length: { in: 2..self.columns_hash['value'].limit }
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
 
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Dictionary
3
- VERSION = '0.1'.freeze
3
+ VERSION = '0.2'.freeze
4
4
  end
5
5
  end
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.1'
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-10 00:00:00.000000000 Z
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common