include_date_scopes 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/lib/include_date_scopes/define_timestamp_scopes.rb +3 -9
- data/lib/include_date_scopes/version.rb +1 -1
- data/spec/spec_helper.rb +0 -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: cc5fb55e3cee51dc62e328c214250470e036e233
|
4
|
+
data.tar.gz: 67e4dfba26a4d5f5657ebb6a7034d9288a2e61de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36d1795e13fc032fe64b76021e418c1d844f88860643f6eb3e7778ef36eb28e8907a53974d8d2b58968dbe8349dbe0e5ef6e980b998f7abfb3f6134f5536766f
|
7
|
+
data.tar.gz: adaaa58c900d48536e13c3ba5884141e5e434e0e0f220c054150dfcb9f6d3feeceea2d7f1edc278dcdeef0ddcf2060bef0ef71d36fc78d56ad6feee7036ae6ca
|
data/Gemfile
CHANGED
@@ -8,7 +8,7 @@ gemspec
|
|
8
8
|
# * If you have any local gems to include, create a new Gemfile at ~/.Gemfile
|
9
9
|
# * This code will import anything in there.
|
10
10
|
# *************************************
|
11
|
-
if File.exist? File.join(Dir.home,'.Gemfile')
|
12
|
-
|
13
|
-
end
|
11
|
+
# if File.exist? File.join(Dir.home,'.Gemfile')
|
12
|
+
# eval File.read File.join(Dir.home,'.Gemfile')
|
13
|
+
# end
|
14
14
|
|
@@ -17,11 +17,11 @@ module IncludeDateScopes
|
|
17
17
|
end
|
18
18
|
|
19
19
|
define_singleton_method :"#{prefix}on_or_before" do |time|
|
20
|
-
where(t[column_name].lteq
|
20
|
+
where(t[column_name].lteq (time.is_a?(Date) ? time.to_time : time))
|
21
21
|
end
|
22
22
|
|
23
23
|
define_singleton_method :"#{prefix}before" do |time|
|
24
|
-
where(t[column_name].lt
|
24
|
+
where(t[column_name].lt (time.is_a?(Date) ? time.to_time : time))
|
25
25
|
end
|
26
26
|
|
27
27
|
define_singleton_method :"#{prefix}on_or_after_date" do |time|
|
@@ -29,7 +29,7 @@ module IncludeDateScopes
|
|
29
29
|
end
|
30
30
|
|
31
31
|
define_singleton_method :"#{prefix}on_or_after" do |time|
|
32
|
-
where(t[column_name].gteq
|
32
|
+
where(t[column_name].gteq (time.is_a?(Date) ? time.to_time + 1.day : time ))
|
33
33
|
end
|
34
34
|
|
35
35
|
define_singleton_method :"#{prefix}after" do |time|
|
@@ -76,12 +76,6 @@ module IncludeDateScopes
|
|
76
76
|
|
77
77
|
define_common_scopes prefix, column_name
|
78
78
|
end
|
79
|
-
|
80
|
-
private
|
81
|
-
|
82
|
-
def time_object(time)
|
83
|
-
time.is_a?(Date) ? time.to_time + 1.day : time
|
84
|
-
end
|
85
79
|
end
|
86
80
|
end
|
87
81
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: include_date_scopes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Todd
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|