c80_shared 0.1.9 → 0.1.10

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
- SHA1:
3
- metadata.gz: fa7f6666b59ba7a52fb884bf341eaf24a17cfb92
4
- data.tar.gz: e407fe01bcddfe7dea7292707e49fcd0bc4c50bc
2
+ SHA256:
3
+ metadata.gz: dbf9b57a675dbf83fcb136687a553a0077cb6b9248200450b0def5142fe610fc
4
+ data.tar.gz: bec8f94f959622b9ee7230228d9c9c7e234e60b77d97d05e984ff1f114aa8650
5
5
  SHA512:
6
- metadata.gz: 5b8d0f09a04894e441b09c38ed23296a8aca88016e6794e59fa26e4c368a9ae92cabd8766f2d5e722695fded593d28c879f94cb2caf1d65705222f3715648a3f
7
- data.tar.gz: eadff5f8150ef5ca6d497189ed21caf1b80a32ab0317469518c778aa1d35c3e23a391768b0d05a08a840655a8c0e8e09fb1397250d2a20c489e0509fa118e1c3
6
+ metadata.gz: a0b3be2c3e9b9019b8a3486546f7882991f19544e2630463120f49d195b1b26701c182624800a9e8f2bec0405aa7e82289b95db31a32619a6b819d5b98681d51
7
+ data.tar.gz: e856cd32c840d17d3556d689a76106d389ad80af1735209506f43d203f4815ca965f58a03d324d474894a30d1fd258d1f31a6ce651866e1e3d7bca381f029503
@@ -0,0 +1,7 @@
1
+ module Dicts
2
+ class Currency < ::Dict
3
+ USD = new(1, 'USD')
4
+ EUR = new(2, 'EUR')
5
+ RUB = new(3, 'RUB')
6
+ end
7
+ end
@@ -46,6 +46,7 @@ class BoatSerializer < AbstractSerializer
46
46
  boat_model
47
47
  location_address
48
48
  latitude
49
+ longitude
49
50
  boat_type_id
50
51
  boat_length_metrics
51
52
  boat_length_metrics_meters
@@ -56,6 +57,9 @@ class BoatSerializer < AbstractSerializer
56
57
  boat_draft_metrics
57
58
  boat_draft_metrics_ft
58
59
  boat_draft_metrics_meters
60
+ state
61
+ boat_contacts
62
+ boat_photos
59
63
  ].freeze
60
64
  end
61
65
 
@@ -327,5 +331,30 @@ class BoatSerializer < AbstractSerializer
327
331
  { sale_price_eur: boat.sale_price_eur || '' }
328
332
  end
329
333
 
334
+ def state(boat)
335
+ { state: boat.state }
336
+ end
337
+
338
+ def boat_photos(boat)
339
+ boat_photos = boat.boat_photos.map do |boat_photo|
340
+ {
341
+ gallery_path: boat_photo.picture.url(:gallery),
342
+ medium_path: boat_photo.picture.url(:medium),
343
+ thumb_path: boat_photo.picture.url(:thumb)
344
+ }
345
+ end
346
+ { boat_photos: boat_photos }
347
+ end
348
+
349
+ def boat_contacts(boat)
350
+ boat_contacts = boat.users.map do |user|
351
+ {
352
+ id: user.id,
353
+ name: user.name,
354
+ email: user.email
355
+ }
356
+ end
357
+ { boat_contacts: boat_contacts }
358
+ end
330
359
  end
331
360
  end
@@ -1,3 +1,3 @@
1
1
  module C80Shared
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
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.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-22 00:00:00.000000000 Z
11
+ date: 2018-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -49,6 +49,7 @@ files:
49
49
  - ".rubocop.yml"
50
50
  - Gemfile
51
51
  - README.md
52
+ - app/dicts/currency.rb
52
53
  - app/dicts/email_token_subj.rb
53
54
  - app/dicts/rent_skip_type.rb
54
55
  - app/helpers/custom/currency_helper.rb
@@ -103,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  version: '0'
104
105
  requirements: []
105
106
  rubyforge_project:
106
- rubygems_version: 2.5.2.3
107
+ rubygems_version: 2.7.3
107
108
  signing_key:
108
109
  specification_version: 4
109
110
  summary: Write a short summary, because RubyGems requires one.