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 +4 -4
- data/app/serializers/boat_serializer.rb +24 -8
- data/lib/c80_shared/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd089f176cd766486dbe048062a8633eb2c3d72de2e67b04fc22d9f6cb1bd3aa
|
4
|
+
data.tar.gz: abe64d6e72fd85fafcf638b4cf193b6f87060a207136b0b25526223046e12a2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
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)
|
data/lib/c80_shared/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|