unidom-party 1.7.2 → 1.8

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: b868fa96a813bc4016b38b489f7e1ed478b3322c
4
- data.tar.gz: 538f1f4fbdee2705dec4305e37008bedf6978013
3
+ metadata.gz: 4f97dc47c14f77777321e2d260be44647f441b5e
4
+ data.tar.gz: d9d74b9229ad412ffb94fe2752fce6dae223bd0d
5
5
  SHA512:
6
- metadata.gz: 70a9c73379093f5f350823dd6c0efdd0ad800e3ecf808a2110338437cf9f21b359f5538f51a2622c11c02860a685635bbb895758e7b2d34a01e96c275fa45ed3
7
- data.tar.gz: 0cb642c59ce21866f782ed5aca905ec2abb30835f76466d18a1b707cb3116c5e780dafa23f591792f6965a3578728229f050b3fc79ab733c05278d8228e90f82
6
+ metadata.gz: e48cd2709b2f595b3ccb2952be27841919ce0376fc8e83d1f9bad457deab9327001854e885e12afa5e969c5fb3d1801b762de222c5f74a53c6a1831f3d5de05b
7
+ data.tar.gz: d4ef7f2652c482d565bb58a1222e4c3b845bf39f646fe3706ea76a7aae6986f7363dc06f1042862bb9b56d7380d43c42773c5b50bf39fdbb6c29db036c324a7f
data/README.md CHANGED
@@ -97,3 +97,18 @@ The As Collaborator concern do the following tasks for the includer automaticall
97
97
  1. Define the has_many :collaboratings macro as: ``has_many :collaboratings, class_name: 'Unidom::Party::Collaborating', as: :collaborator``
98
98
  2. Define the #collaborate! method as: ``collaborate!(on: nil, as: nil, at: Time.now, name: nil, priority: 0, grade: 0)``
99
99
  3. Define the #collaborate? method as: ``collaborate?(on: nil, as: nil, at: Time.now, priority: 0, grade: 0)``
100
+
101
+
102
+
103
+ ## Enum codes
104
+
105
+ ### Gender enum code
106
+
107
+ ```ruby
108
+ # http://en.wikipedia.org/wiki/ISO/IEC_5218
109
+ # ISO 5218, GB/T 2261-1980
110
+ Unidom::Party::Gender::NOT_KNOWN
111
+ Unidom::Party::Gender::MALE
112
+ Unidom::Party::Gender::FEMALE
113
+ Unidom::Party::Gender::NOT_APPLICABLE
114
+ ```
@@ -0,0 +1,7 @@
1
+ class Unidom::Party::Gender < ActiveRecord::Type::Value
2
+
3
+ include ProgneTapera::EnumConfig
4
+
5
+ enum :unidom_gender
6
+
7
+ end
data/config/enum.yml ADDED
@@ -0,0 +1,13 @@
1
+ enum:
2
+
3
+ # http://en.wikipedia.org/wiki/ISO/IEC_5218
4
+ # ISO 5218, GB/T 2261-1980
5
+ unidom_gender:
6
+ not_known:
7
+ code: '0'
8
+ male:
9
+ code: '1'
10
+ female:
11
+ code: '2'
12
+ not_applicable:
13
+ code: '9'
@@ -0,0 +1,10 @@
1
+ 'zh-CN':
2
+ enum:
3
+
4
+ # http://en.wikipedia.org/wiki/ISO/IEC_5218
5
+ # ISO 5218, GB/T 2261-1980
6
+ unidom_gender:
7
+ not_known: 未知
8
+ male: 男
9
+ female: 女
10
+ not_applicable: 保密 # 未说明
@@ -1,9 +1,15 @@
1
+ require 'unidom/common/yaml_helper'
2
+
1
3
  module Unidom
2
4
  module Party
3
5
  class Engine < ::Rails::Engine
4
6
 
5
7
  isolate_namespace ::Unidom::Party
6
8
 
9
+ initializer :load_config_initializers do |app|
10
+ Unidom::Common::YamlHelper.load_enum config: app.config, root: config.root
11
+ end
12
+
7
13
  initializer :append_migrations do |app|
8
14
  config.paths['db/migrate'].expanded.each { |expanded_path| app.config.paths['db/migrate'] << expanded_path } unless app.root.to_s.match root.to_s
9
15
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Party
3
- VERSION = '1.7.2'.freeze
3
+ VERSION = '1.8'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-party
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.2
4
+ version: '1.8'
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-11-08 00:00:00.000000000 Z
11
+ date: 2016-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -54,7 +54,10 @@ files:
54
54
  - app/models/unidom/party/party_relation.rb
55
55
  - app/models/unidom/party/person.rb
56
56
  - app/models/unidom/party/shop.rb
57
+ - app/types/unidom/party/gender.rb
57
58
  - app/views/layouts/unidom/party/application.html.erb
59
+ - config/enum.yml
60
+ - config/locales/enum.zh-CN.yml
58
61
  - config/routes.rb
59
62
  - db/migrate/20010101000000_create_unidom_party_relations.rb
60
63
  - db/migrate/20010102000000_create_unidom_people.rb