toast 1.1.3 → 1.1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5006fc39ec85167eec2ed0180d48bf319c0d66196588c87936ddee8f3187431e
|
4
|
+
data.tar.gz: 0507cd5e2f352e76697fa0c20827069bcb30ed132917bd97e9addd09fb896941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8a9dbb3b375a90d9cd6373b5f98797a2e8b68802fbe661327fa39790b409f1d0328d19d10816fd694cfd57fb30cb986e02097eb38b88586d7d6b6eb36200da9
|
7
|
+
data.tar.gz: 30d1f68fb1c1af20399eb4daca1e305eb0f2dc7a6fc3c7dcc9257aa0ba30a247478caff9d62d3f0069f4679c3db64fb7c7ddcca8f32d55dda060d9b212408058
|
@@ -49,7 +49,7 @@ class Toast::CollectionRequest
|
|
49
49
|
@auth, relation, @uri_params)
|
50
50
|
|
51
51
|
if relation.is_a?(ActiveRecord::Relation) and
|
52
|
-
relation.model== @config.base_model_class
|
52
|
+
relation.model.name == @config.base_model_class.name
|
53
53
|
|
54
54
|
result = relation.limit(window).offset(range_start)
|
55
55
|
|
@@ -64,7 +64,7 @@ class Toast::ConfigDSL::Base
|
|
64
64
|
self.associations = {}
|
65
65
|
end
|
66
66
|
|
67
|
-
if Toast.expositions.detect{|exp| exp.model_class == config_data.model_class}
|
67
|
+
if Toast.expositions.detect{|exp| exp.model_class.name == config_data.model_class.name}
|
68
68
|
raise_config_error "Model class #{exp.model_class} has already another configuration."
|
69
69
|
end
|
70
70
|
|
@@ -53,7 +53,7 @@ class Toast::PluralAssocRequest
|
|
53
53
|
source = @base_config.model_class.find(@id) # may raise ActiveRecord::RecordNotFound
|
54
54
|
relation = call_handler(@config.via_get.handler, source, @uri_params) # may raise HandlerError
|
55
55
|
|
56
|
-
unless relation.is_a? ActiveRecord::Relation and relation.model == @config.target_model_class
|
56
|
+
unless relation.is_a? ActiveRecord::Relation and relation.model.name == @config.target_model_class.name
|
57
57
|
return response :internal_server_error,
|
58
58
|
msg: "plural association handler returned `#{relation.class}', expected `ActiveRecord::Relation' (#{@config.target_model_class})"
|
59
59
|
end
|
@@ -107,7 +107,7 @@ class Toast::SingularAssocRequest
|
|
107
107
|
return response :not_found, msg: "target class `#{target_model_class.name}' is not an `ActiveRecord'"
|
108
108
|
end
|
109
109
|
|
110
|
-
if target_model_class != @config.target_model_class
|
110
|
+
if target_model_class.name != @config.target_model_class.name
|
111
111
|
return response :bad_request,
|
112
112
|
msg: "target class `#{target_model_class.name}' invalid, expect: `#{@config.target_model_class}'"
|
113
113
|
end
|
@@ -164,7 +164,7 @@ class Toast::SingularAssocRequest
|
|
164
164
|
return response :not_found, msg: "target class `#{target_model_class.name}' is not an `ActiveRecord'"
|
165
165
|
end
|
166
166
|
|
167
|
-
if target_model_class != @config.target_model_class
|
167
|
+
if target_model_class.name != @config.target_model_class.name
|
168
168
|
return response :bad_request,
|
169
169
|
msg: "target class `#{target_model_class.name}' invalid, expect: `#{@config.target_model_class}'"
|
170
170
|
end
|
data/lib/toast/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- robokopp (Robert Annies)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|