Permalink
Browse files

Added readme and license

  • Loading branch information...
1 parent 066f33c commit 7239afef363e3237243ca3aef7ea69b89db9d6d5 @bcardarella committed Jan 27, 2011
Showing with 37 additions and 0 deletions.
  1. +21 −0 MIT-LICENSE.txt
  2. +16 −0 README.markdown
View
@@ -0,0 +1,21 @@
+Copyright (c) 2011 Brian Cardarella
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
View
@@ -0,0 +1,16 @@
+# BetterAr
+
+BetterAr adds replaces the .all, .first and .count methods for ActiveRecord.
+
+Now a single hash can be passed to ActiveRecord::Base.all that contains not only the where values but also other scopes like 'limit' and 'order'
+
+ User.all(:age => 10, :limit => 5, :offset => 10, :order => :name)
+
+is the same as
+
+ User.where(:age => 10).limit(5).offset(10).order(:name)
+
+While this may seem less concise the advantage is being able to dynamically construct the query with a single hash in code.
+
+Brian Cardarella - 2011
+

0 comments on commit 7239afe

Please sign in to comment.