thoughtbot-pacecar 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README.rdoc +13 -0
  2. data/lib/pacecar.rb +2 -0
  3. metadata +2 -2
data/README.rdoc CHANGED
@@ -44,7 +44,10 @@ And some basic model declarations...
44
44
  include Pacecar
45
45
  has_many :posts, :as => :owner
46
46
  has_many :comments
47
+ has_many :articles
47
48
  has_ranking :comments
49
+ has_recent_records :comments
50
+ has_recent_records :articles, :comments
48
51
  end
49
52
 
50
53
  class Post < ActiveRecord::Base
@@ -62,6 +65,10 @@ And some basic model declarations...
62
65
  belongs_to :user
63
66
  end
64
67
 
68
+ class Article < ActiveRecord::Base
69
+ belongs_to :user
70
+ end
71
+
65
72
  = All columns
66
73
 
67
74
  Records where approved_at is not null, or where it is null...
@@ -154,6 +161,12 @@ Records with the most and least associated records...
154
161
  User.maximum_comments
155
162
  User.minimum_comments
156
163
 
164
+ Records with associated records since a certain time...
165
+
166
+ User.recent_comments_since(2.days.ago)
167
+ User.recent_comments_and_posts_since(3.days.ago)
168
+ User.recent_comments_or_posts_since(4.days.ago)
169
+
157
170
  = State columns
158
171
 
159
172
  Records which are in a particular state, or not in a state...
data/lib/pacecar.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'pacecar/associations'
1
2
  require 'pacecar/boolean'
2
3
  require 'pacecar/datetime'
3
4
  require 'pacecar/duration'
@@ -13,6 +14,7 @@ require 'pacecar/state'
13
14
  module Pacecar
14
15
  def self.included(base)
15
16
  base.class_eval do
17
+ include Pacecar::Associations
16
18
  include Pacecar::Boolean
17
19
  include Pacecar::Datetime
18
20
  include Pacecar::Duration
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thoughtbot-pacecar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Jankowski
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-08 00:00:00 -07:00
12
+ date: 2009-04-17 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15