c80_shared 0.1.33 → 0.1.34

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
  SHA256:
3
- metadata.gz: 2018a901c7704054ba4433b0891ce3d3bb0a19644d85344d52c2b9dfd4d90489
4
- data.tar.gz: 10325288d0fdc13b1e8e97867f1fcbd3f06da589d001148c59c4941856ea0150
3
+ metadata.gz: bd089f176cd766486dbe048062a8633eb2c3d72de2e67b04fc22d9f6cb1bd3aa
4
+ data.tar.gz: abe64d6e72fd85fafcf638b4cf193b6f87060a207136b0b25526223046e12a2e
5
5
  SHA512:
6
- metadata.gz: abc853aff0959634e0e95629be2b276980602eaf842c624c623e413094d862acc8fedf3783ffc94fe51b0a3f76f80c1720e3774f29c3df4ddab38ac2cece94da
7
- data.tar.gz: b3043462144edb23b4b37b567d92e3f777c1183d19c5226e6d75c91945714b9fa3465caa4e5d698f077674f73038be91bbc5f21832dfc756399646771198d6e2
6
+ metadata.gz: f5173095f3e5574251e85c8c6593df607ac0c0d7360ed71aa02903280d4a88591a182dba7ec45c7a54a3435c2750fee194f653b2acdb5cf0af43dd5263db1935
7
+ data.tar.gz: ded4cdd6e25b6ee23bac73fc98180db32c494cb255c1431b358edf32d77cbdd0f73f28e3289f24466411eb439fe4d3b7079efc3a93c23c32a07a7830f00f3e78
@@ -35,12 +35,15 @@ class BoatSerializer < AbstractSerializer
35
35
  longitude
36
36
  main_boat_photo_id
37
37
  motor
38
+ motor_id
38
39
  name
39
40
  naval_architect
40
41
  picture_medium_url
41
42
  prices
42
43
  refit_year
44
+ rent_prices
43
45
  rental_type
46
+ sale_price
44
47
  short_description
45
48
  state
46
49
  visits_today
@@ -95,8 +98,8 @@ class BoatSerializer < AbstractSerializer
95
98
  m = ::Dicts::Motor.find boat.motor
96
99
  {
97
100
  motor: {
98
- id: (m.id rescue -1),
99
- index: (m.index rescue 'null')
101
+ id: (m.id rescue nil),
102
+ index: (m.index rescue 'null') # 'null' - индекс в локалях
100
103
  }
101
104
  }
102
105
  end
@@ -123,8 +126,8 @@ class BoatSerializer < AbstractSerializer
123
126
  color = ::Dicts::ExteriorColor.find boat.exterior_color
124
127
  {
125
128
  exterior_color: {
126
- id: (color.id rescue -1),
127
- index: (color.index rescue 'null')
129
+ id: (color.id rescue nil),
130
+ index: (color.index rescue 'null') # 'null' - индекс в локалях
128
131
  }
129
132
  }
130
133
  end
@@ -172,8 +175,8 @@ class BoatSerializer < AbstractSerializer
172
175
  hm = ::Dicts::HullMaterial.find boat.hull_material
173
176
  {
174
177
  hull_material: {
175
- id: (hm.id rescue -1),
176
- index: (hm.index rescue 'null')
178
+ id: (hm.id rescue nil),
179
+ index: (hm.index rescue 'null') # 'null' - индекс в локалях
177
180
  }
178
181
  }
179
182
  end
@@ -182,8 +185,8 @@ class BoatSerializer < AbstractSerializer
182
185
  hm = ::Dicts::RentSkipType.find boat.rental_type
183
186
  {
184
187
  rental_type: {
185
- id: (hm.id rescue -1),
186
- index: (hm.index rescue 'null')
188
+ id: (hm.id rescue nil),
189
+ index: (hm.index rescue 'null') # 'null' - индекс в локалях
187
190
  }
188
191
  }
189
192
  end
@@ -314,6 +317,19 @@ class BoatSerializer < AbstractSerializer
314
317
  }
315
318
  end
316
319
 
320
+ def rent_prices(boat)
321
+ currency_id = ::Dicts::Currency.find_by_index(@opts[:currency]).id
322
+ {
323
+ rent_prices: boat.boat_prices
324
+ .select { |bp| bp.currency_id == currency_id }
325
+ .map.each_with_index { |bp, index| ::BoatPriceSerializer.serialize(bp).merge(id:index) }
326
+ }
327
+ end
328
+
329
+ def sale_price(boat)
330
+
331
+ end
332
+
317
333
  # --[low]-----------------------------------------------------------------------------------------------------------
318
334
 
319
335
  # def charter_1_hour_low_usd(boat)
@@ -1,3 +1,3 @@
1
1
  module C80Shared
2
- VERSION = "0.1.33"
2
+ VERSION = "0.1.34"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c80_shared
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.33
4
+ version: 0.1.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-07 00:00:00.000000000 Z
11
+ date: 2019-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler