scopie_rails 0.8.0 → 0.9.0

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: 3bb41290b07a829393e1f6a02793b320afdce972
4
- data.tar.gz: 5152212ca1822242d3aed6b7a8fa144e6ddc2502
3
+ metadata.gz: ca85d081e530a2ac068173cd2a7fd4f852db701a
4
+ data.tar.gz: c5831f1d5e0916bc2dbfb1cb24eaa70e4e57ca0e
5
5
  SHA512:
6
- metadata.gz: 80512b1d6eb25594df3a92956eb3d28a2df5923a5e4f9eeb77a84f92ee8eab383704f07cd76c370aa1387a031925b695213da6dc0aa469e4acdde79844411db1
7
- data.tar.gz: 2540e408c676d420b38a5a45aabd63835aa7fe579c68fac8cf9352d6cd6b91e0b756ec42151492b6bfc9c04245d87dddba8a62309bf880ce1d026c586bd2860e
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, :by_period
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ScopieRails
4
- VERSION = '0.8.0'
4
+ VERSION = '0.9.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scopie_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Kotov