scopie_rails 0.8.0 → 0.9.0
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 +4 -4
- data/README.md +14 -2
- data/lib/scopie_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca85d081e530a2ac068173cd2a7fd4f852db701a
|
4
|
+
data.tar.gz: c5831f1d5e0916bc2dbfb1cb24eaa70e4e57ca0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4b8102f996e5385b37bef89361a31cc45fa3ec8bbe787a90f3b5335547866390bcc2b3e7d2c32cdd2bee57133572e173461e6ced53258d2bfb699a6ce9fff5c
|
7
|
+
data.tar.gz: 8030201ad90dc31645ddaa363c2e9682b03fbb61375244868b367401b4e58c16f19aeb7af22b37b102fee525061c993c10ff57f72be764020b87fc3507e79e5c
|
data/README.md
CHANGED
@@ -35,11 +35,15 @@ You can use those named scopes as filters by declaring them on your scopie:
|
|
35
35
|
class GraduationsScopie < ScopieRails::Base
|
36
36
|
|
37
37
|
has_scope :featured, type: :boolean
|
38
|
-
has_scope :by_degree, :
|
38
|
+
has_scope :by_degree, type: :integer
|
39
|
+
has_scope :by_period
|
39
40
|
|
40
41
|
has_scope :created_at_greater_than, in: :created_at, as: :start_at
|
41
42
|
has_scope :created_at_less_than, in: :created_at, as: :end_at
|
42
43
|
|
44
|
+
has_scope :updated_at_greater_than, in: :updated_at, as: :start_at, type: :date
|
45
|
+
has_scope :updated_at_less_than, in: :updated_at, as: :end_at, type: :date
|
46
|
+
|
43
47
|
has_scope :page, default: 1
|
44
48
|
has_scope :per, default: 30
|
45
49
|
|
@@ -58,6 +62,14 @@ class GraduationsScopie < ScopieRails::Base
|
|
58
62
|
scope.created_at_less_than(parse_date(value))
|
59
63
|
end
|
60
64
|
|
65
|
+
def updated_at_greater_than(scope, value, _hash)
|
66
|
+
scope.updated_at_greater_than(value)
|
67
|
+
end
|
68
|
+
|
69
|
+
def updated_at_less_than(scope, value, _hash)
|
70
|
+
scope.updated_at_less_than(value)
|
71
|
+
end
|
72
|
+
|
61
73
|
private
|
62
74
|
|
63
75
|
def parse_date(value)
|
@@ -110,7 +122,7 @@ gem 'scopie_rails'
|
|
110
122
|
|
111
123
|
Scopie supports several options:
|
112
124
|
|
113
|
-
* `:type` - Coerces the type of the parameter sent. Available options: boolean, integer, date.
|
125
|
+
* `:type` - Coerces the type of the parameter sent. Available options: boolean, integer, float, date.
|
114
126
|
|
115
127
|
* `:only` - In which actions the scope is applied.
|
116
128
|
|
data/lib/scopie_rails/version.rb
CHANGED