Permalink
Browse files

Convert readme examples to use stabby lambda

All scopes should be callables in Rails 4, and it works both ways in 3.2
as well.
  • Loading branch information...
1 parent 5f554de commit 38a29d76f0862814ff22c81357a95b3cb04d3c99 @carlosantoniodasilva carlosantoniodasilva committed May 8, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 README.md
View
@@ -9,8 +9,8 @@ Imagine the following model called graduations:
```ruby
class Graduation < ActiveRecord::Base
- scope :featured, where(:featured => true)
- scope :by_degree, proc { |degree| where(:degree => degree) }
+ scope :featured, -> { where(:featured => true) }
+ scope :by_degree, -> degree { where(:degree => degree) }
end
```
@@ -88,7 +88,7 @@ HasScope supports several options:
## Block usage
-has_scope also accepts a block. The controller, current scope and value are yielded
+`has_scope` also accepts a block. The controller, current scope and value are yielded
to the block so the user can apply the scope on its own. This is useful in case we
need to manipulate the given value:

0 comments on commit 38a29d7

Please sign in to comment.