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: 3ffc230d6241fe54b81431776232f63395f8149f3632e01ef7151ea353de46bd
4
- data.tar.gz: f04101583f930052ad231149b6fb8026784eea410c01f170caea81729026deb7
3
+ metadata.gz: 5006fc39ec85167eec2ed0180d48bf319c0d66196588c87936ddee8f3187431e
4
+ data.tar.gz: 0507cd5e2f352e76697fa0c20827069bcb30ed132917bd97e9addd09fb896941
5
5
  SHA512:
6
- metadata.gz: ee500860d0639ae2c7e8e9e767d8acd6d9a1edd005237a83adb85401800bd68124f2d8add562039439c04833444ddcccc9fd88e7c744775feda96379d28e15d7
7
- data.tar.gz: ea3d957809f004f730786b4182ddaa16a7616e1089bd0a1c7cd4141e68f6e603e4feaf4ab1e23f3b6a18920fcedbdff05c82fdc85d5e5c1c88d4671d92aec1d6
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
@@ -4,7 +4,7 @@ module Toast::RequestHelpers
4
4
 
5
5
  def get_config model_class
6
6
  Toast.expositions.detect do |exp|
7
- exp.model_class == model_class
7
+ exp.model_class.name == model_class.name
8
8
  end || raise(Toast::Errors::ConfigNotFound)
9
9
  end
10
10
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Toast
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.4'
3
3
  end
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.3
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-01-14 00:00:00.000000000 Z
11
+ date: 2021-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails