tramway-api 1.8.6.10 → 1.8.6.11

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: eac6742207080fc85dd8b83884206f932e8b92dd9ac29a9ee748274bff7f823a
4
- data.tar.gz: 3fc429d2b9e90a4cd4b1349aa03541057e60147f59a8312cd1bb39e390cd62b3
3
+ metadata.gz: df04e623451ee6c2e632f318925f3f0c90a3f75af5f50fdbf4dba7b44642d90e
4
+ data.tar.gz: c5c71de5a66e7821b648cb2a2c501e4df11c1f3e2745015fb8c1ed050c2a8e99
5
5
  SHA512:
6
- metadata.gz: 8fc3526803e3cc00c3eebcc1728042e9dde54fa6f1c9b8e9df8a21960544afaac4b0a2f9b899b85380977fafa0c28670eac9a9c21fc15c162207c77d5dccd1b3
7
- data.tar.gz: cba7da12631b2f8010348dc1f460ff1bfaccdcb4586badb78163b21ea55be708337ce596133c65a59c35c70f8d45c4cf4948beb3f015e06f75ade4b81bc68ca4
6
+ metadata.gz: 882cefd561e168aabca2c72eaff7eb5f5781f88659cc7c7f6ebc8431c90d2ff7fde947bae8f6977cf6fe392c5473a27543769eb09ebd1268cda6713422f236b3
7
+ data.tar.gz: 2906e2e3d2d85dd9712091a1651c0ab3aabb797e810443e2513a3a1d97b07b896237e2745b19256af1e308739b2876dfbc0249efd76cce5c540d10a20211b737
@@ -23,6 +23,40 @@ module Tramway
23
23
  hash
24
24
  end
25
25
 
26
+ # Need to be removed
27
+
28
+ before_action :load_application
29
+
30
+ def load_application
31
+ if engine_loaded(request).present?
32
+ build_application_with_engine engine_loaded request
33
+ elsif application_class(request).present?
34
+ @application = application_class(request).camelize.constantize.first
35
+ else
36
+ @application = application_object request
37
+ end
38
+ end
39
+
40
+ private
41
+
42
+ def build_application_with_engine(engine_loaded)
43
+ engine_module = "::Tramway::#{engine_loaded.camelize}".constantize
44
+ @application = "#{engine_module}::#{engine_module.application.to_s.camelize}".constantize.first
45
+ @application_engine = engine_loaded
46
+ end
47
+
48
+ def application_class(request)
49
+ Constraints::DomainConstraint.new(request.domain).application_class
50
+ end
51
+
52
+ def engine_loaded(request)
53
+ Constraints::DomainConstraint.new(request.domain).engine_loaded
54
+ end
55
+
56
+ def application_object(request)
57
+ Constraints::DomainConstraint.new(request.domain).application_object
58
+ end
59
+
26
60
  private
27
61
 
28
62
  def record
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Api
5
- VERSION = '1.8.6.10'
5
+ VERSION = '1.8.6.11'
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.10
4
+ version: 1.8.6.11
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-06 00:00:00.000000000 Z
11
+ date: 2021-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers