order_order 1.0.0 → 1.1.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: a26645f321275ccfdaa5139bf30ff8a9665988f9
4
- data.tar.gz: 5007c39623d4b65dbfe2c56d2be9abc81859cb91
3
+ metadata.gz: 385eef577f3ac59c140a2acc2cc2dc87e02e6d23
4
+ data.tar.gz: 72a973ad20e5bf28f3047d72181ec6299ee20298
5
5
  SHA512:
6
- metadata.gz: 2077144f2407104227e9d3bfd4588607689f00a8c34cf9f2472c12f16c1ec5e48b1b632f584ed26477362c43d72c6e691712df4658b4d3a866d54de4cd410607
7
- data.tar.gz: cd46ef598a7371cd7904456fafc3111d076642264d9e239d74c2177aa0c6fd9b3393f077ac1fc6183923d49c759c281d761b4fdc033442ce349713039d8ea1d6
6
+ metadata.gz: ae6708c35065f7c31cab2539b466bab454a5da9ad5eef6ef80656029f4d180d844aed1a5be1c314cbf8bc44acd89400f2a023963eaafa511c50f12724111cc98
7
+ data.tar.gz: c862b50aeb63a06355e393b01752d0a51226ff4528ccd7ba8e1861d4b1796e1977b89d030ad3e3ed53bcecac24a5190de0ef5aa4e347e9f614a61ba9a23362ff
data/README.md CHANGED
@@ -33,6 +33,19 @@ override this, pass the column name to the methods:
33
33
 
34
34
  Post.alphabetical("title") # => ActiveRecord::Relation
35
35
  Comment.reverse_chronological("time") # => ActiveRecord::Relation
36
+
37
+ There is also a finder method called `since`:
38
+
39
+ user_0 = User.create(created_at: 5.days.ago)
40
+ user_1 = User.create(created_at: 3.days.ago)
41
+ user_2 = User.create(created_at: 2.days.ago)
42
+
43
+ new_users = User.since(4.days.ago)
44
+
45
+ new_users.include?(user_0) # => false
46
+ new_users.include?(user_1) # => true
47
+ new_users.include?(user_2) # => true
48
+
36
49
 
37
50
  ## Contributing
38
51
 
@@ -41,6 +41,14 @@ module OrderOrder
41
41
  # or `self.name_column` at the model level would negate the need to pass an
42
42
  # argument to these methods.
43
43
 
44
+
45
+ # Return all records created SINCE the provided date
46
+ #
47
+ # @param [Time]
48
+ # @return [ActiveRecord::Relation]
49
+ def since(time)
50
+ where("created_at > ?", time)
51
+ end
44
52
  end
45
53
  end
46
54
 
@@ -1,3 +1,3 @@
1
1
  module OrderOrder
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: order_order
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Millo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-28 00:00:00.000000000 Z
11
+ date: 2015-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -88,9 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.4.4
91
+ rubygems_version: 2.4.6
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Order in the (ActiveRecord) court!
95
95
  test_files: []
96
- has_rdoc: