ocean-rails 5.5.4 → 5.5.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 +4 -4
- data/lib/ocean/ocean_application_controller.rb +3 -2
- data/lib/ocean/version.rb +1 -1
- 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: 0c0d4fe8dcd55f095e2e21d3da13cbb27a067d3d
|
4
|
+
data.tar.gz: d7f773d3e392636ccfea0e547070760014749d3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 285c28a1d6c6073807c5e8946cb886182df341880d9de2cc2f98c082f42c88786736deaa46be355b2e3659a450bd6f72b0e1ba8adddcf4fd8e25b0da246e80b1
|
7
|
+
data.tar.gz: 0479aca4787c429c56ed1665b2618f44d28fc44949fc688b88f6831d600f5d091414b5f648ff7c3ea56e11596f101742f4e3f208782fcec68e0b6dcab8354430
|
@@ -159,7 +159,7 @@ module OceanApplicationController
|
|
159
159
|
# their standard position, begin with an underscore, etc. The +ocean+ gem generator
|
160
160
|
# for resources creates a partial in the proper location.
|
161
161
|
#
|
162
|
-
def api_render(x, new: false, href: url_for(params), override_partial: false)
|
162
|
+
def api_render(x, new: false, href: x.present? && url_for(params), override_partial: false)
|
163
163
|
if !x.is_a?(Array) && !(defined?(ActiveRecord) && x.is_a?(ActiveRecord::Relation))
|
164
164
|
partial = override_partial || x.to_partial_path
|
165
165
|
if new
|
@@ -173,9 +173,10 @@ module OceanApplicationController
|
|
173
173
|
locals: {m.class.model_name.i18n_key => m}) }
|
174
174
|
count = resources.count
|
175
175
|
total_count = x.respond_to?(:unscope) ? x.unscope(:limit, :offset).count : count
|
176
|
+
resource_type = x.is_a?(Array) ? x.first && x.first.class.table_name.singularize : x.table_name.singularize
|
176
177
|
attrs = {count: count,
|
177
178
|
total_count: total_count,
|
178
|
-
resource_type:
|
179
|
+
resource_type: resource_type
|
179
180
|
}
|
180
181
|
links = {}
|
181
182
|
if href
|
data/lib/ocean/version.rb
CHANGED