tramway-api 1.8.6.11 → 1.8.7.1

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: df04e623451ee6c2e632f318925f3f0c90a3f75af5f50fdbf4dba7b44642d90e
4
- data.tar.gz: c5c71de5a66e7821b648cb2a2c501e4df11c1f3e2745015fb8c1ed050c2a8e99
3
+ metadata.gz: c1faafafdc03424f40bb3675cca9cd65a974c0fcdd12e5aea93a9e938c4ac780
4
+ data.tar.gz: a14a18d4b13ed34ae78e24efc07dd6a47f67612633086b5e6988f13f6286a5a8
5
5
  SHA512:
6
- metadata.gz: 882cefd561e168aabca2c72eaff7eb5f5781f88659cc7c7f6ebc8431c90d2ff7fde947bae8f6977cf6fe392c5473a27543769eb09ebd1268cda6713422f236b3
7
- data.tar.gz: 2906e2e3d2d85dd9712091a1651c0ab3aabb797e810443e2513a3a1d97b07b896237e2745b19256af1e308739b2876dfbc0249efd76cce5c540d10a20211b737
6
+ metadata.gz: e1f1524a1819cf04ec8776dcbbd6751395c0bdf7197fd01c5515e8be13ae1e0c0865acd9d6a233d073a3b242d7a0566d87d5921a42bfad0a3646b75d5412f620
7
+ data.tar.gz: 203d0b68c69a8767c51e9937fccbc0a5bebe3c6e9b95c8db1c12a05970f3314fc6ae2aaf6ca84501cd7fab2856bc483fcff0e495dd8e15133ed5b130db2e14bf
@@ -7,8 +7,6 @@ module Tramway
7
7
  protect_from_forgery with: :null_session, if: proc { |c| c.request.format == 'application/json' }
8
8
  rescue_from ActiveRecord::RecordNotFound, with: :not_found if Rails.env.production?
9
9
 
10
- private
11
-
12
10
  def not_found
13
11
  render json: { data: [] }, status: :not_found
14
12
  end
@@ -4,8 +4,6 @@ module Tramway
4
4
  module Api
5
5
  module V1
6
6
  class ApplicationController < ::Tramway::Api::ApplicationController
7
- before_action :application
8
-
9
7
  def render_errors_for(model)
10
8
  render json: model, status: :unprocessable_entity, serializer: ::Tramway::Api::V1::ErrorSerializer
11
9
  end
@@ -23,40 +21,6 @@ module Tramway
23
21
  hash
24
22
  end
25
23
 
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
-
60
24
  private
61
25
 
62
26
  def record
@@ -8,9 +8,11 @@ module Tramway::Api::V1
8
8
  before_action :application
9
9
 
10
10
  def index
11
- collection = available_action_for_collection
11
+ @collection = available_action_for_collection
12
12
 
13
- render json: collection,
13
+ raise 'Collection has empty uuid. It should not be empty, because all records with empty uuid will not be rendered' if @collection.map(&:uuid).map(&:empty?).include? true
14
+
15
+ render json: @collection,
14
16
  each_serializer: serializer_class,
15
17
  include: '*',
16
18
  status: :ok
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Api
5
- VERSION = '1.8.6.11'
5
+ VERSION = '1.8.7.1'
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.11
4
+ version: 1.8.7.1
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-07 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.10.5
19
+ version: 0.10.12
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.10.5
26
+ version: 0.10.12
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: knock
29
29
  requirement: !ruby/object:Gem::Requirement