Permalink
Browse files

Update dependencies and documentation, also remove `init.rb` files.

  • Loading branch information...
1 parent a4bd8d4 commit 4640c7cdd1c5c3a4289bab1eccaa2e47fdddf262 @lucasmazza lucasmazza committed Jul 6, 2012
Showing with 10 additions and 16 deletions.
  1. +3 −2 Gemfile
  2. +7 −13 README.md
  3. +0 −1 init.rb
View
@@ -2,10 +2,11 @@ source :rubygems
gemspec
-gem "rails", "~> 3.0.3"
+gem "actionpack", "~> 3.2.0"
+gem "activesupport", "~> 3.2.0"
if RUBY_VERSION < "1.9"
- gem "ruby-debug"
+ gem "ruby-debug"
else
gem "test-unit"
end
View
@@ -5,8 +5,8 @@ Imagine the following model called graduations:
```ruby
class Graduation < ActiveRecord::Base
- named_scope :featured, :conditions => { :featured => true }
- named_scope :by_degree, proc {|degree| { :conditions => { :degree => degree } } }
+ scope :featured, where(:featured => true)
+ scope :by_degree, proc { |degree| where(:degree => degree) }
end
```
@@ -54,16 +54,10 @@ In the last case, it would return: { :featured => true, :by_degree => "phd" }.
## Installation
-HasScope is available as gem on Gemcutter, so just run the following:
+Add `has_scope` to your Gemfile or install it from Rubygems.
-```
-sudo gem install has_scope
-```
-
-If you want it as plugin, just do:
-
-```
-script/plugin install git://github.com/plataformatec/has_scope.git
+```ruby
+gem 'has_scope'
```
## Options
@@ -104,7 +98,7 @@ When used with booleans, it just receives two arguments and is just invoked if t
```ruby
has_scope :not_voted_by_me, :type => :boolean do |controller, scope|
- scope.not_voted_by(controller.current_user.id)
+ scope.not_voted_by(controller.current_user.id)
end
```
@@ -114,4 +108,4 @@ If you discover any bugs or want to drop a line, feel free to create an issue on
http://github.com/plataformatec/has_scope/issues
-MIT License. Copyright 2009 Plataforma Tecnologia. http://blog.plataformatec.com.br
+MIT License. Copyright 2012 Plataformatec. http://blog.plataformatec.com.br
View
@@ -1 +0,0 @@
-require 'has_scope'

0 comments on commit 4640c7c

Please sign in to comment.