type_scopes 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/numeric_scopes.rb +3 -1
- data/lib/type_scopes/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20ec6bc0d92b4379d1c4b6aeb486004fc37d215f
|
4
|
+
data.tar.gz: 615034c211e3e76a9c3dbb1ef99e4622accb8b23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22d1c02c5d20db0e3c9bb60e15185994dd42ec973923ce1230f681a000af7f01e00022363ab1f207201540e889db495505dd5ea080cc02c68891a039dabc6678
|
7
|
+
data.tar.gz: a2b9e392771c5bcf7d178b5dc45514bdb3f324fc0707491a68f54a3472dbb1544847fbc9351c5f05e882a5d18bbc3b47fcd422af30a1765bbf0139b22d99b435
|
data/lib/numeric_scopes.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
module NumericScopes
|
2
|
+
TYPES = ["integer", "double precision", "numeric"].freeze
|
3
|
+
|
2
4
|
def self.included(model)
|
3
5
|
model.extend(ClassMethods)
|
4
6
|
model.create_numeric_scopes
|
@@ -7,7 +9,7 @@ module NumericScopes
|
|
7
9
|
module ClassMethods
|
8
10
|
def create_numeric_scopes
|
9
11
|
for column in columns
|
10
|
-
if column.sql_type
|
12
|
+
if TYPES.include?(column.sql_type)
|
11
13
|
create_numeric_scopes_for_column(column.name)
|
12
14
|
end
|
13
15
|
end
|
data/lib/type_scopes/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: type_scopes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Useful scopes based on columns' types (dates, times, strings and numerics).
|
14
14
|
email:
|