tramway-api 1.8.6.8 → 1.8.6.9

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: 7afaf17fee7b310b01015af00a05f9d8105bab57ee5c8f2582513088bf07a134
4
- data.tar.gz: 10ccdf3863f5cd527bc5e007e39d2b5512cda862b668d64202583a58a1a01ac4
3
+ metadata.gz: 715fdb8596a8e3e42aaf7d8bf7150e004488f53e5522d960cb4b355c4c5d77fb
4
+ data.tar.gz: 140d4c0e45a45791677f9942995be2d9f277391e0633e804aaaa8aeb63c185da
5
5
  SHA512:
6
- metadata.gz: 60433f37641ba07db8bbd32a55c318a0578df5fe92f5fb77b458a043c4e26b384772dcc744ed11d537a9cb72e8cb9f4f1b13e5cf85246f82f2a9ae33ebcfe311
7
- data.tar.gz: 2ee8ae129c4165fe3ef452a63aea87b00b6115e30f9091adf34ac2f9552b2fbefbb78a68f00cbab2d54a0dc04587938a08f30364950b55d94c9468b329f00764
6
+ metadata.gz: b1a164a8e6aff4f1a6485ff3952a488fa74f7a3baf21d2c2cb12b5b22d56f6a79bfbd98932ec8740a8d06c8833a756b5eebf1038cef754450226be6287161139
7
+ data.tar.gz: 9aeb6d5b7699ac269dde2417a8a1c9a742cbabaff6505731fc42055d1af548539cc379600cbd73818caf68e90e1a8d05e17da5552d6085be853c1e26f5dd647f
@@ -112,7 +112,18 @@ module Tramway
112
112
  protected
113
113
 
114
114
  def application_name
115
- @application.present? ? @application.name : raise('Tramway::Api @application not initialized')
115
+ if @application.present?
116
+ @application.name
117
+ else
118
+ if ::Tramway::Core.application
119
+ @application = Tramway::Core.application&.model_class&.first || Tramway::Core.application
120
+ end
121
+ if @application.present?
122
+ @application.name
123
+ else
124
+ raise("Tramway::Api @application not initialized, Tramway::Core.application: #{::Tramway::Core.application}, model_class: #{Tramway::Core.application&.model_class }")
125
+ end
126
+ end
116
127
  end
117
128
 
118
129
  def model_class
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Api
5
- VERSION = '1.8.6.8'
5
+ VERSION = '1.8.6.9'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6.8
4
+ version: 1.8.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2021-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers