unidom-common 0.3 → 0.4

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: b762a8f1dd896cb9b2aedf15951e45078d187005
4
- data.tar.gz: 12594c213dd5c99097c8b4db93d3a20fdd92f5d9
3
+ metadata.gz: d23c262b1fe69ebda87106043fb0a586acdd0800
4
+ data.tar.gz: e6d24fc0fa119ba363ec4aa0125dffc15d13c74f
5
5
  SHA512:
6
- metadata.gz: 840850a62bd7c587f1526a84a2ab3014953fab5186ed4099dc93f228bd172263727b70ed129076410b83d9b9cdec7d2b7094cd7478b1064d47387c66f8dffe65
7
- data.tar.gz: 24bd5269ad107265bd9dbaefb9d62d36b21bea802af5716c02741f22c7c938463d6a58bc99a1b2bb90b305b72858e6b56a907c6ca8fc4840b4eb16514a598f4f
6
+ metadata.gz: 81cdc0a4232129d75c1c458ebbe8050552bed642ed89e3632a7301ea184c08238b09e40fd8b44204600153a542149643a67252cdcabf73ab0c6964d7b79ff22f
7
+ data.tar.gz: d7e7a7e5d864e38e212de73466d16a957f7367d92e9dafc1d96fb73dcbe64286bec1fa5225e8ec63e7f3d86855a2115fdac727a701d0736d810fdd15fac081b2
data/README.md CHANGED
@@ -41,3 +41,33 @@ Project.coded_as('JIRA').valid_at(Time.now).alive(true) # Same as Project.co
41
41
  team.projects.valid_during('2015-01-01'..'2015-12-31').dead
42
42
  Project.included_by([ id_1, id_2 ]).excluded_by id_3
43
43
  ```
44
+
45
+ ## ActiveRecord Migration Naming Convention
46
+ ### Domain Models (200YMMDDHHMMSS)
47
+ * unidom-common: 200001DDHHMMSS
48
+ * unidom-visitor: 200002DDHHMMSS
49
+ * unidom-category: 200003DDHHMMSS
50
+ * unidom-authorization: 200004DDHHMMSS
51
+ * unidom-accounting: 200005DDHHMMSS
52
+ * unidom-standard: 200006DDHHMMSS
53
+ * unidom-party: 200101DDHHMMSS
54
+ * unidom-certificate: 200102DDHHMMSS
55
+ * unidom-contact: 200103DDHHMMSS
56
+ * unidom-geo: 200104DDHHMMSS
57
+ * unidom-property: 200105DDHHMMSS
58
+ * unidom-article_number: 200201DDHHMMSS
59
+ * unidom-product: 200202DDHHMMSS
60
+ * unidom-price: 200203DDHHMMSS
61
+ * unidom-commodity: 200204DDHHMMSS
62
+ * unidom-shopping: 200205DDHHMMSS
63
+ * unidom-order: 200206DDHHMMSS
64
+ * unidom-promotion: 200207DDHHMMSS
65
+ * unidom-payment: 200208DDHHMMSS
66
+
67
+ ### Country Extensions (200YMM9NNNMMSS)
68
+ The YMM part should be identical to the relative part of the Domain Models.
69
+ The NNN is the numeric code of [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1 "codes for the names of countries, dependent territories, and special areas of geographical interest").
70
+ The numeric code of China is 156.
71
+ * unidom-certificate-china: 2001029156MMSS
72
+ * unidom-contact-china: 2001039156MMSS
73
+ * unidom-geo-china: 2001049156MMSS
@@ -120,7 +120,11 @@ module Unidom
120
120
  end
121
121
 
122
122
  module ClassMethods
123
- # def method_name do end
123
+
124
+ def to_id(model)
125
+ model.respond_to?(:id) ? model.id : model
126
+ end
127
+
124
128
  end
125
129
 
126
130
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Common
3
- VERSION = '0.3'.freeze
3
+ VERSION = '0.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-common
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
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-01-28 00:00:00.000000000 Z
11
+ date: 2016-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -113,5 +113,5 @@ rubyforge_project:
113
113
  rubygems_version: 2.4.5.1
114
114
  signing_key:
115
115
  specification_version: 4
116
- summary: The Common domain model engine includes the common models.
116
+ summary: Unidom Common Domain Model Engine 常用领域模型引擎
117
117
  test_files: []