subroutine 0.10.0.beta9 → 0.10.0.beta10

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: f4e568d027e2b761473b800a74f078576b4abb6f66d507d23bd965348ea189c5
4
- data.tar.gz: bd172e96b99b247414e12d91e40a3de2c26c1a4875f2dbd60d7f8c240486cb9a
3
+ metadata.gz: 70efa6b815728e1b2d8e3117ebc40b629d98f7f150528a1901ff7e03f763fa10
4
+ data.tar.gz: 28d84cad0e8508b32c0f7ad93d3c79b94a3cdef9b5632c3b933f7f85a04b703b
5
5
  SHA512:
6
- metadata.gz: 40c066cafed1fad6c4ac256f71d96cb8be990691b5b325b0e22b2f324317916bca80d17cc9721790956061474cb133775d31aa9f19b77bc7c50469b6593423c2
7
- data.tar.gz: b442d7d9ff5fe6e1ded23624fc069b1fa5752116450273e4f874607a7b5024fb3bd7e7a68c695c8944fd81fd3484a789c1a2fcd683a7a11cfc64cfb59c0f840a
6
+ metadata.gz: 3d2f21c4f6739a3ad32c5915f7f8eb60efece410ceb78b31f76b1f5f522ee65b669c0f42b4d5c43bd5aedf549cefe7643e837879e1cf513676491017aa8a6bf1
7
+ data.tar.gz: '06698f7f7ddd4993ee0e6651a8f1b38f665fc770be023d532bd7b5671030213f26f58b18cf58c1d569433f6ce41854b98909f94bbd15b1ba8a5261e97a77d512'
@@ -88,10 +88,13 @@ module Subroutine
88
88
  super(args.extract_options!, &block)
89
89
 
90
90
  @skip_auth_checks = false
91
- @current_user = args.shift
92
91
 
93
- unless self.class.supported_user_class_names.include?(current_user.class.name)
94
- raise ArgumentError, "current_user must be one of the following types {#{self.class.supported_user_class_names.join(",")}} but was #{current_user.class.name}"
92
+ user = args.shift
93
+
94
+ if self.class.supported_user_class_names.include?(user.class.name)
95
+ @current_user = user
96
+ else
97
+ raise ArgumentError, "current_user must be one of the following types {#{self.class.supported_user_class_names.join(",")}} but was #{user.class.name}"
95
98
  end
96
99
  end
97
100
 
@@ -5,7 +5,7 @@ module Subroutine
5
5
  MAJOR = 0
6
6
  MINOR = 10
7
7
  PATCH = 0
8
- PRE = "beta9"
8
+ PRE = "beta10"
9
9
 
10
10
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
11
11
 
@@ -113,5 +113,10 @@ module Subroutine
113
113
  end
114
114
  end
115
115
 
116
+ def test_current_user_is_not_called_by_constructor
117
+ ::User.expects(:find).never
118
+ RequireUserOp.new(user.id)
119
+ end
120
+
116
121
  end
117
122
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subroutine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0.beta9
4
+ version: 0.10.0.beta10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nelson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-27 00:00:00.000000000 Z
11
+ date: 2020-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel