netzke-basepack 0.10.0 → 0.10.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9555745375e3416e1ed7245c19954efc2452e419
|
4
|
+
data.tar.gz: 100ad99cc0d671888337566bfd283c5931cb50de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa8f2ab4a856ec66cb085ff3cbb75d5c213fed89b7d730c78665813a3dede88558b84b6a1a32617cea5f9564d4abb6b015fda81c7e98fb0ddd367f682158bf11
|
7
|
+
data.tar.gz: 47f4e98169cc321950b879bad349403c87d0a68e26ad63c26277f64c202085a216efb66900524bee10bd58c47dc532cdb69772a1a015c0c2b9f84bac78d746c0
|
data/CHANGELOG.md
CHANGED
@@ -4,18 +4,16 @@ module Netzke
|
|
4
4
|
module RelationExtensions
|
5
5
|
def extend_with(*params)
|
6
6
|
scope = params.shift
|
7
|
-
case scope
|
8
|
-
when
|
7
|
+
case scope
|
8
|
+
when Symbol # model's scope
|
9
9
|
self.send(scope, *params)
|
10
|
-
when
|
10
|
+
when String # SQL query or SQL query with params (e.g. ["created_at < ?", 1.day.ago])
|
11
11
|
params.empty? ? self.where(scope) : self.where([scope, *params])
|
12
|
-
when
|
12
|
+
when Array
|
13
13
|
self.extend_with(*scope)
|
14
|
-
when
|
14
|
+
when Hash # conditions hash
|
15
15
|
self.where(scope)
|
16
|
-
when
|
17
|
-
self.where(scope)
|
18
|
-
when "Proc" # receives a relation, must return a relation
|
16
|
+
when Proc # receives a relation, must return a relation
|
19
17
|
scope.call(self)
|
20
18
|
else
|
21
19
|
raise ArgumentError, "Wrong parameter type for ActiveRecord::Relation#extend_with"
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netzke-basepack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Gorin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: netzke-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.10.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.10.0
|
27
27
|
- !ruby/object:Gem::Dependency
|