dscf-marketplace 0.5.8 → 0.5.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70882435873ee86597be2d46062d0f957ccfbf839e41c5b65a8fe7ec9cbedca2
|
4
|
+
data.tar.gz: 2c4c404bac6fec1acac34345399219c50cfb1b996394b581d9c99f804704e07a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d388ab9e9a400904a630f43ac2cc63c4f7f0e12302b4a7000f3e48a4d7155e2a3bf3a904e2685b8c9f32ecf0de00111950e7ccc858d8413504cc56318c758657
|
7
|
+
data.tar.gz: 9d556b6d0adc478bcf4bed2db6c46f25b34e8c2f29caf2b640111648e826dd9237dc877104af9d18b8a4e03136ec3db6ff24f9fcc8acd9d625f40b36e77893c7
|
@@ -42,14 +42,21 @@ module Dscf
|
|
42
42
|
service = MyResourceService.new(current_user)
|
43
43
|
businesses = service.my_businesses(params)
|
44
44
|
|
45
|
+
# Ensure reviewed_by is loaded for reviews
|
46
|
+
businesses.each do |business|
|
47
|
+
business.reviews.each do |review|
|
48
|
+
review.reviewed_by
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
45
52
|
options = {
|
46
|
-
include: [ :business_type, :user, :documents, {reviews:
|
53
|
+
include: [ :business_type, :user, :documents, {reviews: :reviewed_by} ],
|
47
54
|
meta: {resource_type: "my_businesses"}
|
48
55
|
}
|
49
56
|
|
50
57
|
# Manually serialize to ensure reviews are included
|
51
58
|
serialized = businesses.map do |business|
|
52
|
-
BusinessSerializer.new(business, options).as_json
|
59
|
+
Dscf::Core::BusinessSerializer.new(business, options).as_json
|
53
60
|
end
|
54
61
|
|
55
62
|
render_success(data: serialized, meta: {resource_type: "my_businesses"})
|
@@ -67,7 +74,7 @@ module Dscf
|
|
67
74
|
def eager_loaded_associations
|
68
75
|
[
|
69
76
|
:business_type, :user, :documents,
|
70
|
-
reviews:
|
77
|
+
reviews: :reviewed_by
|
71
78
|
]
|
72
79
|
end
|
73
80
|
|
@@ -76,20 +83,20 @@ module Dscf
|
|
76
83
|
index: [
|
77
84
|
:business_type, :user, :documents,
|
78
85
|
{
|
79
|
-
reviews:
|
86
|
+
reviews: :reviewed_by
|
80
87
|
}
|
81
88
|
],
|
82
89
|
show: [
|
83
90
|
:business_type, :user, :documents,
|
84
91
|
{
|
85
|
-
reviews:
|
92
|
+
reviews: :reviewed_by
|
86
93
|
}
|
87
94
|
],
|
88
95
|
create: [ :business_type, :user, :documents, :reviews ],
|
89
96
|
update: [
|
90
97
|
:business_type, :user, :documents,
|
91
98
|
{
|
92
|
-
reviews:
|
99
|
+
reviews: :reviewed_by
|
93
100
|
}
|
94
101
|
]
|
95
102
|
}
|
@@ -11,7 +11,7 @@ module Dscf
|
|
11
11
|
|
12
12
|
def thumbnail_url
|
13
13
|
if object.thumbnail.attached?
|
14
|
-
ActiveStorage::Current.set(url_options: {host: "dscf.bitscollege.edu.et", protocol: "https", script_name: "/api
|
14
|
+
ActiveStorage::Current.set(url_options: {host: "dscf.bitscollege.edu.et", protocol: "https", script_name: "/api"}) do
|
15
15
|
object.thumbnail.url
|
16
16
|
end
|
17
17
|
end
|
@@ -19,7 +19,7 @@ module Dscf
|
|
19
19
|
|
20
20
|
def image_urls
|
21
21
|
if object.images.attached?
|
22
|
-
ActiveStorage::Current.set(url_options: {host: "dscf.bitscollege.edu.et", protocol: "https", script_name: "/api
|
22
|
+
ActiveStorage::Current.set(url_options: {host: "dscf.bitscollege.edu.et", protocol: "https", script_name: "/api"}) do
|
23
23
|
object.images.map(&:url)
|
24
24
|
end
|
25
25
|
else
|
@@ -28,7 +28,7 @@ module Dscf
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def my_businesses(params = {})
|
31
|
-
@current_user.businesses.includes(:business_type, :user, :documents, reviews:
|
31
|
+
@current_user.businesses.includes(:business_type, :user, :documents, reviews: :reviewed_by)
|
32
32
|
end
|
33
33
|
|
34
34
|
def my_listings(params = {})
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dscf-marketplace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asrat
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-10-
|
10
|
+
date: 2025-10-13 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|