subroutine 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1eb7328166962d1dfee177ad4311926c7958217
4
- data.tar.gz: f5133fc409be40473d1c14a0ae1880b1d007a35d
3
+ metadata.gz: aa94532ef601e196c3dd4f4592a1bdcc18a4fd90
4
+ data.tar.gz: b8da58c3642568051893934fd92e227508907eaf
5
5
  SHA512:
6
- metadata.gz: a9bb3b82b53ef32a8f0d236c4e2561d7c56ce5c233f520a06bded564017e32e7d017758f43e0dff4d80c425b476e5ea95562d1f0414b7c26bd4e0d426efa8244
7
- data.tar.gz: d4752345399d5ed62c138438ac80050c55de4ca84163d3c2121aed0bd7b404ffd36cc1caf6447d83a28bf570602f007bb5c55d59b70965e7dd6224831f350702
6
+ metadata.gz: 5ce7d236825bd9b5e861913b717cbfbe9d4cdb5da7964cc3fc9ed6691645548dde4a7a2d0f5727839e2f30b0d03ba5bbd3fc05500455c6e9025df2a4077adc93
7
+ data.tar.gz: d31335231526c84b9e2bd118a21b88f51c005c1dab7d7a2afc586fb5211d8e8f0089aa2d733e2d55cda995a1ec0d404b43194549ce2597b22f4ed2f37d056a17
@@ -118,7 +118,7 @@ module Subroutine
118
118
  return nil unless _type && _id
119
119
 
120
120
  klass = _type
121
- klass = klass.camelize.constantize if klass.is_a?(String)
121
+ klass = klass.classify.constantize if klass.is_a?(String)
122
122
 
123
123
  return nil unless klass
124
124
 
@@ -2,7 +2,7 @@ module Subroutine
2
2
 
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
@@ -27,6 +27,16 @@ module Subroutine
27
27
  assert_equal doug, op.user
28
28
  end
29
29
 
30
+ def test_it_sanitizes_types
31
+ all_mock = mock
32
+
33
+ ::User.expects(:all).returns(all_mock)
34
+ all_mock.expects(:find).with(1).returns(doug)
35
+
36
+ op = SimpleAssociationOp.new user_type: "users", user_id: doug.id
37
+ assert_equal doug, op.user
38
+ end
39
+
30
40
  def test_it_allows_an_association_to_be_looked_up_without_default_scoping
31
41
  all_mock = mock
32
42
  unscoped_mock = mock
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subroutine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nelson