azahara_schema 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cad1d215a81fc9ee38b04fe40d66a5c8d6a8ba393f11cb1cc044fdfaa6e8c64
4
- data.tar.gz: 970ce5ed71ef57d8cef07d8e7ae7de6c93a02bbc29e91e28c84f1e20869c6038
3
+ metadata.gz: 90e7c8c4bcba4a03fc760342834e6d41da75254716d2a85c3bcaa3c29a3b16b7
4
+ data.tar.gz: 2cafa249a27c2bedd66fe1ad8da3bbd6c87a5d7e6e3aa62d49cdf7adc8c3a35b
5
5
  SHA512:
6
- metadata.gz: 5b85f8c934c6d5697807e9a48b50244e39dc73e3f440dd13dd3449bcc5dada083ff3ee3bbe31148b621736695c25f9df314b3317f7a64d3ba1275fd5f4a965fd
7
- data.tar.gz: 493524455ea502b20762c1f877d45c4729961dba7691a0d8e03e8cee33c2c6367a26a9c97d506bafd3b3b94c700b694f86142919f8bbd3cc1bcf0fb85f0c70be
6
+ metadata.gz: cfae28b25d20524be4c1df713330300b633fa4423c25b53c1da59cf3c1874351e89e43940e2175d830edd36cfbaa490f804413dc901eb760838b2c3bf50855d1
7
+ data.tar.gz: '0569975263efd31d2cd9e268c06637f1ba63b63caaac46dd812aecd3d7a86c11f91e3ed59845395075318530008b19c51b04e2ded7dc777662e958d46f73a88b'
@@ -53,7 +53,13 @@ module AzaharaSchema
53
53
  end
54
54
 
55
55
  def azahara_export_path(schema, export_format)
56
- polymorphic_path(schema.model, schema.to_param.merge(format: export_format))
56
+ model = if schema.model.is_a?(ActiveRecord::Relation)
57
+ schema.model.klass
58
+ else
59
+ schema.model
60
+ end
61
+
62
+ polymorphic_path(model, schema.to_param.merge(format: export_format))
57
63
  rescue NoMethodError => err
58
64
  nil
59
65
  end
@@ -1,3 +1,3 @@
1
1
  module AzaharaSchema
2
- VERSION = '0.4.4'
2
+ VERSION = '0.4.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azahara_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-09 00:00:00.000000000 Z
11
+ date: 2022-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails