menilite 0.5.5 → 0.5.6

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
  SHA256:
3
- metadata.gz: c317e28a8910d938484dbea1431a8ebac0e66a094641e6e80506f41dc5e18054
4
- data.tar.gz: 5344962b1388ffbcba13d4edd3ada16037b18c6387d15493ad3ba2ef8eb59109
3
+ metadata.gz: 39b69eb5eec382500250f033e5156e8a92e4811cbb865976d6dc69b43def1a40
4
+ data.tar.gz: 4c6b62aa93fcf6ed3cb28f4cc8f4539fc58b6a11c4654e9bfa5dc21b871b0d08
5
5
  SHA512:
6
- metadata.gz: df8013186d7e01816cb655e5d72773cc3b0de44a9cca2cd33dfe38f1fea45466cc8e201e763b997d8770243c5c55cdd27665a96d19d9d4df7a88c821a0a3b01f
7
- data.tar.gz: c411bcd675aaabf4a4b86501a943cb18adf5c764cecff1075f9bcfe4bc14cb5ec28efbddcf0b9444d2651e9a14cfe2e79a504836c496cdc944e8079b6b64c1e6
6
+ metadata.gz: 6f9a6e102780769e7b76f3ce3cd017d2e60f4346ad9cfbfbf372791b7e377c8d37968437c355b6cf5127604a66ad663615d789f894030c8aa297b476c7397824
7
+ data.tar.gz: fb197f8b37e7ed3330803ef58c0b78945f963308c411ba403777b9b06340f555600f466b408f89b2f39962e68d3e1e5451b1749273704c773f6440fbbeda525c
@@ -459,7 +459,14 @@ module Menilite
459
459
 
460
460
  def resolve_references(key, value)
461
461
  if self.class.field_info.has_key?(key) && self.class.field_info[key].type == :reference
462
- ["#{key}_id".to_sym, value.id]
462
+ case value
463
+ when Menilite::Model
464
+ ["#{key}_id".to_sym, value.id]
465
+ when Hash
466
+ ["#{key}_id".to_sym, value[:guid]]
467
+ else
468
+ raise "value is #{value.class}"
469
+ end
463
470
  else
464
471
  [key, value]
465
472
  end
@@ -1,3 +1,3 @@
1
1
  module Menilite
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: menilite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - youchan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-06 00:00:00.000000000 Z
11
+ date: 2019-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler