rest_framework 0.8.0 → 0.8.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: 285ffa895b2f49246b09e98dce670236ee322c5323c4f715b7cd9e27675b8a48
4
- data.tar.gz: eead75ee8eaee0a62bcefe469e3957cedc480047b8819c4109c46c7ccd6f1372
3
+ metadata.gz: 99cd96572042191fde2bb7fa5b004ac07e193c103c8c18342ea3fed3f50e1be7
4
+ data.tar.gz: 2276cedd0fc4b205e0c253df36dbba2a45fcf889e81a214dcda2d435cc690ff7
5
5
  SHA512:
6
- metadata.gz: aa0ddef34da4717063c928a48d30fd08d9629db792e7560d03b15ba6bd2b77532715bd76de4348ab27c03ca556d26e2bf6b8bf625a7d972aa11370b67fc387b0
7
- data.tar.gz: fc654b64c4cfe8e014047ee04a4c0eb60990a7d28491fe82686259c870098b27dcaa8a49e69f4fd650f50c51917ac9c5206fd1a49449a171d12816f615908b29
6
+ metadata.gz: fdcd6eb5262ffcbcf91692389ce78d0560b9d3e2479eabd00ab296707500a3b2611ec733a085c12df363d31f4d41421ac87a102d365810a04db9973276810b6b
7
+ data.tar.gz: 37504ff11623057cc5b1c7e5bfdc0c688ca95964c72a312fd5adeb71fc7cb11acd0937b3a4f6186d8b0c71b5730cbff521dd098f9689c9e6718b6c5628f9edc0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.8.1
@@ -266,6 +266,13 @@ module RESTFramework::BaseModelControllerMixin
266
266
  # Update `required` if we find a presence validator.
267
267
  metadata[:required] = true if kind == :presence
268
268
 
269
+ # Resolve procs (and lambdas), and symbols for certain arguments.
270
+ if options[:in].is_a?(Proc)
271
+ options = options.merge(in: options[:in].call)
272
+ elsif options[:in].is_a?(Symbol)
273
+ options = options.merge(in: model.send(options[:in]))
274
+ end
275
+
269
276
  metadata[:validators] ||= {}
270
277
  metadata[:validators][kind] ||= []
271
278
  metadata[:validators][kind] << options
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory N. Schmit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-22 00:00:00.000000000 Z
11
+ date: 2023-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails