dscf-banking 0.3.3 → 0.3.5
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: 033d842004e5e6c779e391bb9dca2e43925b3858212b50a94db2f3d8853a0dc1
|
4
|
+
data.tar.gz: eb48ab4b6287afbf75f93801f033c08327d284f127142e7199a7678ee74b3acc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7bcc179bc00d1f81d16394e521b1d54188bd41efc89a0c0d1f9c076648eebc223a9642d3c21790bcb1270d649741b2692f54b74f7b6ec33cded00c44802d122
|
7
|
+
data.tar.gz: b915c7adccc0fcde6e40717023d0f9fe849c5e81298d1797371a4876d5c9dce9dec294b1b08065d23873dd3c210d61b54922d33024ea23fbaf6f3adefe5dad04
|
@@ -28,6 +28,22 @@ module Dscf::Banking
|
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
31
|
+
def full_name
|
32
|
+
account = Dscf::Banking::Account.find_by(account_number: params[:id])
|
33
|
+
if account && account.application && account.application.user
|
34
|
+
user = account.application.user
|
35
|
+
profile = user.respond_to?(:user_profile) ? user.user_profile : nil
|
36
|
+
if profile
|
37
|
+
full_name = [profile.first_name, profile.middle_name, profile.last_name].compact.join(" ")
|
38
|
+
render json: { success: true, data: { full_name: full_name } }
|
39
|
+
else
|
40
|
+
render json: { success: false, error: "User profile not found" }, status: :not_found
|
41
|
+
end
|
42
|
+
else
|
43
|
+
render json: { success: false, error: "Account not found" }, status: :not_found
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
31
47
|
def show
|
32
48
|
account = Dscf::Banking::Account.find(params[:id])
|
33
49
|
render json: {
|
@@ -6,11 +6,11 @@ module Dscf::Banking
|
|
6
6
|
return [] unless object.files.attached?
|
7
7
|
|
8
8
|
if Rails.env.production?
|
9
|
-
ActiveStorage::Current.set(url_options: { host: "dscf.bitscollege.edu.et", protocol: "https" }) do
|
9
|
+
ActiveStorage::Current.set(url_options: { host: "dscf.bitscollege.edu.et", protocol: "https", script_name: "/api" }) do
|
10
10
|
object.files.map(&:url)
|
11
11
|
end
|
12
12
|
else
|
13
|
-
ActiveStorage::Current.set(url_options: { host: "localhost:3000", protocol: "http" }) do
|
13
|
+
ActiveStorage::Current.set(url_options: { host: "localhost:3000", protocol: "http", script_name: "/api" }) do
|
14
14
|
object.files.map(&:url)
|
15
15
|
end
|
16
16
|
end
|
data/config/routes.rb
CHANGED
data/lib/dscf/banking/version.rb
CHANGED