dscf-marketplace 0.6.9 → 0.6.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
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 304ba75880abb6975ba1f97e4268071bafa178d04393d61ff3978c98814f3e3a
|
|
4
|
+
data.tar.gz: 49ba3cbb962c0c515cad40759cdb427fe98e848190b015a48509727b81da774b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e424c88f7009a765386e4537affad040fa7adeac0196842707eb5fa347bead1c966542f893e4f4eb0b911ba598fb203d02c6020d128ee1451ced4090ad9333e6
|
|
7
|
+
data.tar.gz: 3a8f804ab3749994f2f39c536e495cc7533a866075588c6665ae9ab5af93295d2ffeef48f8063a7ddc6526e9aed30268bc13bd05598899fbfbbb924454244150
|
|
@@ -56,15 +56,30 @@ module Dscf
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def thumbnail_url
|
|
59
|
-
|
|
60
|
-
Rails.application.routes.url_helpers.rails_blob_url(thumbnail, host: Rails.application.config.action_mailer.default_url_options[:host])
|
|
59
|
+
attachment_url_for(thumbnail)
|
|
61
60
|
end
|
|
62
61
|
|
|
63
62
|
def images_urls
|
|
64
63
|
return [] unless images.attached?
|
|
65
|
-
images.map
|
|
66
|
-
|
|
64
|
+
images.map { |image| attachment_url_for(image) }
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
private
|
|
68
|
+
def attachment_url_for(attachment)
|
|
69
|
+
return unless attachment.present?
|
|
70
|
+
return if attachment.respond_to?(:attached?) && !attachment.attached?
|
|
71
|
+
|
|
72
|
+
Rails.application.routes.url_helpers.rails_blob_url(attachment, **active_storage_url_options)
|
|
67
73
|
end
|
|
74
|
+
|
|
75
|
+
def active_storage_url_options
|
|
76
|
+
url_options = Rails.application.config.x.active_storage_url_options.presence ||
|
|
77
|
+
Rails.application.routes.default_url_options.presence ||
|
|
78
|
+
Rails.application.config.action_controller.default_url_options.presence ||
|
|
79
|
+
Rails.application.config.action_mailer.default_url_options.presence ||
|
|
80
|
+
{}
|
|
81
|
+
|
|
82
|
+
url_options.to_h.symbolize_keys.compact
|
|
68
83
|
end
|
|
69
84
|
end
|
|
70
85
|
end
|
|
@@ -10,21 +10,11 @@ module Dscf
|
|
|
10
10
|
has_many :supplier_products
|
|
11
11
|
|
|
12
12
|
def thumbnail_url
|
|
13
|
-
|
|
14
|
-
ActiveStorage::Current.set(url_options: { host: "dscf.bitscollege.edu.et", protocol: "https", script_name: "/api" }) do
|
|
15
|
-
object.thumbnail.url
|
|
16
|
-
end
|
|
17
|
-
end
|
|
13
|
+
object.thumbnail_url
|
|
18
14
|
end
|
|
19
15
|
|
|
20
16
|
def image_urls
|
|
21
|
-
|
|
22
|
-
ActiveStorage::Current.set(url_options: { host: "dscf.bitscollege.edu.et", protocol: "https", script_name: "/api" }) do
|
|
23
|
-
object.images.map(&:url)
|
|
24
|
-
end
|
|
25
|
-
else
|
|
26
|
-
[]
|
|
27
|
-
end
|
|
17
|
+
object.images_urls
|
|
28
18
|
end
|
|
29
19
|
end
|
|
30
20
|
end
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
Rails.application.configure do
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
config.x.active_storage_url_options = {
|
|
3
|
+
host: ENV.fetch("ACTIVE_STORAGE_HOST", "dscf-api.bitscollege.edu.et"),
|
|
4
|
+
protocol: ENV.fetch("ACTIVE_STORAGE_PROTOCOL", "https"),
|
|
5
|
+
script_name: ENV.fetch("ACTIVE_STORAGE_SCRIPT_NAME", "/api")
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
config.action_mailer.default_url_options = config.x.active_storage_url_options.dup
|
|
9
|
+
config.action_controller.default_url_options = config.x.active_storage_url_options.dup
|
|
10
|
+
Rails.application.routes.default_url_options.merge!(config.x.active_storage_url_options)
|
|
5
11
|
|
|
6
12
|
config.force_ssl = true
|
|
7
13
|
end
|
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.6.
|
|
4
|
+
version: 0.6.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Asrat
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-03-09 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rails
|