Skip to content

Commit

Permalink
Merge pull request heartcombo#28 from plataformatec/2012
Browse files Browse the repository at this point in the history
2012, folks.
  • Loading branch information
José Valim committed Jul 6, 2012
2 parents a4bd8d4 + 4640c7c commit f89c1c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 7 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
```

Expand All @@ -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
1 change: 0 additions & 1 deletion init.rb

This file was deleted.

0 comments on commit f89c1c0

Please sign in to comment.