activerecord_nested_scope 1.0.3 → 1.0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e410ad54617ffeb9efb8f56397f72ace4642944
|
4
|
+
data.tar.gz: 8c67e79ea1bd658e73637174c011bf6ab037539e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d280f90f2b40e2668406147cb2913654784e89685923a4b36cc1764530826c8c63ff3e698dbebea4ca53ef075ab7bf98e99a4097f22d4df819d2abdace93cc18
|
7
|
+
data.tar.gz: 979cb3d3d2c9fdaef9cd6f5feb094eab90c94df90a1fb13703445056bec510134a9d50ccd448d4a2e7d8d693b0a532b817ebe93b3f6b6c7b194aabea27b0b91b
|
@@ -68,12 +68,12 @@ module ActiveRecordNestedScope
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def root_relation(klass)
|
71
|
-
if @args.is_a?(
|
72
|
-
klass.where(klass.primary_key => @args)
|
73
|
-
elsif @args.is_a?(ActiveRecord::Relation)
|
71
|
+
if @args.is_a?(ActiveRecord::Relation)
|
74
72
|
klass.all.merge(@args)
|
75
|
-
elsif @args
|
73
|
+
elsif @args.is_a?(Hash)
|
76
74
|
klass.where(@args)
|
75
|
+
elsif @args
|
76
|
+
klass.where(klass.primary_key => @args)
|
77
77
|
else
|
78
78
|
klass.all
|
79
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord_nested_scope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshikazu Kaneta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|