scopie 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/scopie.rb +2 -0
- data/lib/scopie/base.rb +6 -1
- data/lib/scopie/version.rb +2 -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: 837a34b1643dff78c53060a3f2e3dec10c7551a5
|
4
|
+
data.tar.gz: 136edd4dc6a54d32ea9877eb0f8d45dcd6bc75be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bd549c2f9b837aa053d48cb7a19ac31bf55b2c4d858c86d77215b3ed4baa53d49b466e3fcbb4ba82a4f19fa1147c76ecd3e6779e4b50bd416cd27ebe8963a7d
|
7
|
+
data.tar.gz: 805125337eb5574256967213d91ea037ff23bb87a186e9db40ae893450b904a5bd6d1ca155bab136eb7f8cbcbdfa3c1059eec4873896882215b7e49fd8e7795d
|
data/README.md
CHANGED
@@ -24,11 +24,11 @@ class Graduation < ActiveRecord::Base
|
|
24
24
|
scope :by_degree, -> (degree) { where(degree: degree) }
|
25
25
|
scope :by_period, -> (started_at, ended_at) { where('started_at = ? AND ended_at = ?', started_at, ended_at) }
|
26
26
|
|
27
|
-
scope :created_at_greater_than, ->(date) { where('
|
28
|
-
scope :created_at_less_than, ->(date) { where('
|
27
|
+
scope :created_at_greater_than, ->(date) { where('created_at >= ?', date.beginning_of_day) }
|
28
|
+
scope :created_at_less_than, ->(date) { where('created_at <= ?', date.end_of_day) }
|
29
29
|
|
30
|
-
scope :updated_at_greater_than, ->(date) { where('
|
31
|
-
scope :updated_at_less_than, ->(date) { where('
|
30
|
+
scope :updated_at_greater_than, ->(date) { where('updated_at >= ?', date.beginning_of_day) }
|
31
|
+
scope :updated_at_less_than, ->(date) { where('updated_at <= ?', date.end_of_day) }
|
32
32
|
|
33
33
|
end
|
34
34
|
```
|
data/lib/scopie.rb
CHANGED
data/lib/scopie/base.rb
CHANGED
@@ -68,7 +68,12 @@ class Scopie::Base
|
|
68
68
|
|
69
69
|
def coerce_value_type(value, type)
|
70
70
|
return value unless type
|
71
|
-
|
71
|
+
|
72
|
+
coercion_method_name = "coerce_to_#{type}"
|
73
|
+
|
74
|
+
respond_to?(coercion_method_name, true) || fail(Scopie::InvalidOptionError.new("Unknown value for option 'type' provided: :#{type}"))
|
75
|
+
|
76
|
+
send(coercion_method_name, value)
|
72
77
|
end
|
73
78
|
|
74
79
|
def coerce_to_boolean(value)
|
data/lib/scopie/version.rb
CHANGED