activefacts-metamodel 1.9.17 → 1.9.18

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: add6e3c8d9f09f1d7c92e94658e9b3a53c937edb
4
- data.tar.gz: dadcd30c0c2c04178dd53d811e384521dbe1bb3e
3
+ metadata.gz: 1a9c5fec87ace6e0757e0266aa42d21ec7208d78
4
+ data.tar.gz: 432d7942772ab7c7eda0a4c93e9369e3f9ef044a
5
5
  SHA512:
6
- metadata.gz: c614110af45ddc88a5181c70ae6b26e04db2d69e10fc07515420942fd70756c34150f615ef3acb4ca99856298f5b6aab64831180d1d22654963074826168b5d9
7
- data.tar.gz: ad3a1fb187d7885d8c5264e6ffe62d8ae26b462d36a06194f88a4d663c63a190818a6c7c02ff81864db41847dfc453ba8c267d376c71bad0cf2881d89bc9e1ba
6
+ metadata.gz: 8876140eafbbd5eb1f67653cab2c5b0233acd1d8f3cae8e79bb6f766085664349f0cc1fcd730adfa5059889b2ded423d3dd686b5e7039ca4e176039211c8b366
7
+ data.tar.gz: 4dd4b1fad6303b5d98abbb703bde756ecdcd756d7b00edf5c76c9d7afec108ad5db569f3bdfcf6129f894ad449f1a39b6f1e0aabc3d11f5c7337b00d5853a48c
@@ -196,12 +196,10 @@ module ActiveFacts
196
196
 
197
197
  when SurrogateKey
198
198
  [ context.surrogate_type,
199
- if in_primary_index and !in_foreign_key
200
- {auto_assign: "commit"}
201
- else
202
- {}
203
- end.
204
- merge!({mandatory: path_mandatory})
199
+ {
200
+ auto_assign: ((in_primary_index && !in_foreign_key) ? "commit" : nil),
201
+ mandatory: path_mandatory
202
+ }
205
203
  ]
206
204
 
207
205
  when ValidFrom
@@ -240,7 +238,7 @@ module ActiveFacts
240
238
  [ vt.name,
241
239
  (length ? {length: length} : {}).
242
240
  merge!(scale ? {scale: scale} : {}).
243
- merge!({ auto_assign: (in_primary_index and !in_foreign_key and is_auto_assigned) }).
241
+ merge!(is_auto_assigned ? { auto_assign: (in_primary_index and !in_foreign_key)} : {}).
244
242
  merge!({mandatory: path_mandatory}).
245
243
  merge!(value_constraint ? {value_constraint: value_constraint} : {})
246
244
  ]
@@ -1,5 +1,5 @@
1
1
  module ActiveFacts
2
2
  module Metamodel
3
- VERSION = "1.9.17"
3
+ VERSION = "1.9.18"
4
4
  end
5
5
  end
@@ -89,7 +89,7 @@ class String
89
89
  count = 0
90
90
  map do |word|
91
91
  if (count += 1) == 1
92
- word
92
+ word.downcase # The camel has his head down
93
93
  else
94
94
  word[0].upcase+word[1..-1].downcase
95
95
  end
@@ -110,6 +110,16 @@ class String
110
110
  snakewords.join(joiner)
111
111
  end
112
112
 
113
+ def shoutwords
114
+ map do |word|
115
+ word.upcase
116
+ end
117
+ end
118
+
119
+ def shoutcase joiner = '_'
120
+ shoutwords.join(joiner)
121
+ end
122
+
113
123
  def to_a
114
124
  self
115
125
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activefacts-metamodel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.17
4
+ version: 1.9.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clifford Heath
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2017-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler