pattana 0.1.15 → 0.1.16

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: cbfceaf4d6435908df3b90a7be837e674bad1ddb
4
- data.tar.gz: f83839dfe597ab71e0029765b2244e3eb806e7f1
3
+ metadata.gz: 23f0498e9dae32310ed005c0d28049d0e4c08080
4
+ data.tar.gz: 35f26c8cb3b77755e39e9b1e88a9d27614749a07
5
5
  SHA512:
6
- metadata.gz: c2e79a926696ffcb9c70f05c9e117f0955d0cbe2d913dcdbacd9ab205b0868145b518b7283baf691cc8461680d139df0c188a03476f65e75b0e356a04ed2f496
7
- data.tar.gz: b38fab1faa4a26ed1b8d315fe6cd1ab5608eacc14bbc59c617bd5350b70f000bee891ccd1726cc0bcd7c737c2787e720ddc74a1c5158705bd6a0b14c6c19a51f
6
+ metadata.gz: ef25b43c62b71683414e29898b6b26eaf046f40a04ed29880c6cc234dbba78038fee61835c8e9d729e592c9588ffa83866c0e57efdc47c5064645c729a8abb2c
7
+ data.tar.gz: 5189be80a84d2b997396fd7b028979de02703a5c768c2fe297120d764105d964884505f34ba7e0a0bb62e9fa527f79863026d9a70c70d93bddff5ea766a41f0b
@@ -3,6 +3,19 @@ class CityPreviewSerializer < ActiveModel::Serializer
3
3
 
4
4
  attributes :id, :name, :priority, :operational
5
5
 
6
- belongs_to :country, serializer: CountryPreviewSerializer
7
- belongs_to :region, serializer: RegionPreviewSerializer
6
+ has_one :country, serializer: CountryPreviewSerializer do
7
+ if object.country
8
+ object.country
9
+ else
10
+ object.build_country
11
+ end
12
+ end
13
+
14
+ has_one :region, serializer: RegionPreviewSerializer do
15
+ if object.region
16
+ object.region
17
+ else
18
+ object.build_region
19
+ end
20
+ end
8
21
  end
@@ -2,5 +2,11 @@ class RegionPreviewSerializer < ActiveModel::Serializer
2
2
  include NullAttributeReplacer
3
3
  attributes :id, :name, :priority, :operational
4
4
 
5
- belongs_to :country, serializer: CountryPreviewSerializer
5
+ has_one :country, serializer: CountryPreviewSerializer do
6
+ if object.country
7
+ object.country
8
+ else
9
+ object.build_country
10
+ end
11
+ end
6
12
  end
@@ -1,3 +1,3 @@
1
1
  module Pattana
2
- VERSION = '0.1.15'
2
+ VERSION = '0.1.16'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pattana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-02 00:00:00.000000000 Z
11
+ date: 2017-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -107,7 +107,7 @@ dependencies:
107
107
  version: '0.1'
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.1.18
110
+ version: 0.1.20
111
111
  type: :runtime
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
@@ -117,7 +117,7 @@ dependencies:
117
117
  version: '0.1'
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 0.1.18
120
+ version: 0.1.20
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: bcrypt
123
123
  requirement: !ruby/object:Gem::Requirement