Skip to content

Instantly share code, notes, and snippets.

@demetriusnunes
Created May 18, 2009 02:58
Show Gist options
  • Save demetriusnunes/113286 to your computer and use it in GitHub Desktop.
Save demetriusnunes/113286 to your computer and use it in GitHub Desktop.
Patch for Ryan Bates' Scope Builder
From e86d28bb6a46160b7b1fc1cf7b55b473aec8ed1e Mon Sep 17 00:00:00 2001
From: Demetrius Nunes <[email protected]>
Date: Sun, 17 May 2009 23:55:26 -0300
Subject: [PATCH] Just fixing the file name of README so it looks better on github
---
README | 56 --------------------------------------------------------
README.rdoc | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 56 deletions(-)
delete mode 100644 README
create mode 100644 README.rdoc
diff --git a/README b/README
deleted file mode 100644
index 1bcf069..0000000
--- a/README
+++ /dev/null
@@ -1,56 +0,0 @@
-= Scope Builder
-
-Build up named scopes conditionally.
-
-
-== Install
-
-First specify it in your Rails config.
-
- config.gem 'ryanb-scope-builder', :lib => 'scope_builder', :source => 'http://gems.github.com'
-
-And then install it.
-
- rake gems:install
-
-Rails 2.1 or later required.
-
-
-== Usage
-
-This gem adds the scope_builder method to all Active Record models. A
-builder behaves exactly like any other named scope except that calling
-other named scopes on it will alter the builder itself rather than
-returning a new named scope.
-
- builder = Product.scope_builder
- builder.released.visible # call a couple named scopes to change builder
- builder.cheap if only_show_cheap_products? # build scopes conditionally
-
-The scope_builder method can also take a block which will return the
-builder. This is useful when you are using the builder in a model
-search method.
-
- # in product model
- def self.search(options)
- scope_builder do |builder|
- builder.released.visible
- builder.cheap if options[:cheap]
- end
- end
-
-The scope_builder method can also be called on an existing scope.
-
- products = Product.released.visible
- builder = products.scope_builder
- builder.cheap if only_show_cheap_products?
-
-
-== Development
-
-This project can be found on github at the following URL.
-
-http://github.com/ryanb/scope-builder/
-
-If you would like to contribute to this project, please fork the
-repository and send me a pull request.
diff --git a/README.rdoc b/README.rdoc
new file mode 100644
index 0000000..1bcf069
--- /dev/null
+++ b/README.rdoc
@@ -0,0 +1,56 @@
+= Scope Builder
+
+Build up named scopes conditionally.
+
+
+== Install
+
+First specify it in your Rails config.
+
+ config.gem 'ryanb-scope-builder', :lib => 'scope_builder', :source => 'http://gems.github.com'
+
+And then install it.
+
+ rake gems:install
+
+Rails 2.1 or later required.
+
+
+== Usage
+
+This gem adds the scope_builder method to all Active Record models. A
+builder behaves exactly like any other named scope except that calling
+other named scopes on it will alter the builder itself rather than
+returning a new named scope.
+
+ builder = Product.scope_builder
+ builder.released.visible # call a couple named scopes to change builder
+ builder.cheap if only_show_cheap_products? # build scopes conditionally
+
+The scope_builder method can also take a block which will return the
+builder. This is useful when you are using the builder in a model
+search method.
+
+ # in product model
+ def self.search(options)
+ scope_builder do |builder|
+ builder.released.visible
+ builder.cheap if options[:cheap]
+ end
+ end
+
+The scope_builder method can also be called on an existing scope.
+
+ products = Product.released.visible
+ builder = products.scope_builder
+ builder.cheap if only_show_cheap_products?
+
+
+== Development
+
+This project can be found on github at the following URL.
+
+http://github.com/ryanb/scope-builder/
+
+If you would like to contribute to this project, please fork the
+repository and send me a pull request.
--
1.5.6.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment