README.rdoc in delta_force-0.0.1 vs README.rdoc in delta_force-0.0.2
- old
+ new
@@ -2,10 +2,12 @@
DeltaForce allows you to use some Postgres 8.4+ window functions in named scopes on your ActiveRecord models.
It is very much still a work in progress; please contribute if possible and let me know what I can do better!
+{<img src="https://travis-ci.org/joelind/delta_force.png" />}[http://travis-ci.org/joelind/delta_force]
+
== Installing
<b>DeltaForce only works with Rails 2.3</b>. I will be adding Rails 3 compatibility shortly.
In your Gemfile:
@@ -67,14 +69,22 @@
Foo.changes_in_x_and_y_and_z_by_bar_id_over_period.first.closing_period
=> "2011-03-11"
Note that opening_* and closing_* values are not currently typecast. I'd like to support that in the future.
+
+You can also retrieve a hash of the values for a given field *as of* the period as follows:
+
+ Foo.x_by_bar_id_as_of_period("2011-03-10")
+ => {1=>2.0, 2=>4.0}
+
+This hash contains the latest x on or before the specified period keyed by the bar_id.
+
== Under the hood
DeltaForce uses {Postgres 8.4+ window functions}[http://www.postgresql.org/docs/current/static/tutorial-window.html] to partition data by an arbitrary key.
-This has been tested agains Postgres 8.4 and should also work with Postgres 9. Oracle provides the same set of functions, but I have not been able to test it against an Oracle instance yet.
+This has been tested against Postgres 8.4 and should also work with Postgres 9. Oracle provides the same set of functions, but I have not been able to test it against an Oracle instance yet.
== Copyright
Copyright (c) 2011 {Joe Lind}[http://github.com/joelind]. See LICENSE for details.