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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f89eae9b3b4c9e7421d6cc58edb49f4df1adbd3
4
- data.tar.gz: 8aea72a77966109927e0241171ae625aafa30bd2
3
+ metadata.gz: cc5fb55e3cee51dc62e328c214250470e036e233
4
+ data.tar.gz: 67e4dfba26a4d5f5657ebb6a7034d9288a2e61de
5
5
  SHA512:
6
- metadata.gz: 3d86c53be5dd357d526d02af98f379030c44b15139ba6960bd4fbefe77112cd5e8c8da78fb583ad2563bdfd52a324c53454b10184632730f74f0a1e67e8fbcff
7
- data.tar.gz: 89c956fa3fd91af23ec584269b732f69a70919e19a26d2e15661ec10792491cf8b55a864707b97a07f2d174a672150ee285794813ae4c4b0042d888e929f230c
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
- eval File.read File.join(Dir.home,'.Gemfile')
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 time_object(time))
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 time_object(time))
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 time_object(time))
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
 
@@ -1,4 +1,4 @@
1
1
 
2
2
  module IncludeDateScopes
3
- VERSION = '0.9.8'.freeze
3
+ VERSION = '0.9.9'.freeze
4
4
  end
data/spec/spec_helper.rb CHANGED
@@ -4,7 +4,6 @@ require 'rails/all'
4
4
  require 'active_record'
5
5
  require 'active_support'
6
6
  require 'include_date_scopes'
7
- require 'pry-byebug'
8
7
 
9
8
  if ActiveSupport::VERSION::MAJOR < 4
10
9
  require 'active_support/core_ext/logger'
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.8
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-02 00:00:00.000000000 Z
12
+ date: 2014-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord