glib-web 0.4.64 → 0.4.65
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/controllers/concerns/glib/json/libs.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2158feb2985dca0cb028b034fbd8b9d9ba94924b
|
4
|
+
data.tar.gz: 5319d4abaa9541211a111ed57c1d505e7a50e154
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 472b176e7a2e6bacb8d3f0e8c562df8e7ac339618f544f4685344d2a2efd04fad2ccdd42735ad134223d447b90fd4dbb89ce4b1dfa31e7780e904149634801ef
|
7
|
+
data.tar.gz: 921148bf350fa27bbd43a8b13770551af7cf872c3fe49944e7f9e2a4b14a51aa16688c1755b2490f707ee69a9a4140a9e13505717a04af4825a08806cae7daab
|
@@ -46,6 +46,14 @@ module Glib::Json::Libs
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
def json_libs_handle_404
|
50
|
+
if json_ui_activated?
|
51
|
+
render file: "#{Rails.root}/public/404.html", status: :not_found
|
52
|
+
else
|
53
|
+
raise exception
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
49
57
|
|
50
58
|
|
51
59
|
module ClassMethods
|
@@ -103,5 +111,11 @@ module Glib::Json::Libs
|
|
103
111
|
end
|
104
112
|
end
|
105
113
|
|
114
|
+
def json_libs_rescue_404
|
115
|
+
rescue_from ActiveRecord::RecordNotFound do |exception|
|
116
|
+
json_libs_handle_404
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
106
120
|
end
|
107
121
|
end
|