Skip to content

Commit

Permalink
Merge pull request #3 from jish/readme
Browse files Browse the repository at this point in the history
Updating readme.
  • Loading branch information
dzaporozhets committed Nov 13, 2011
2 parents 0a38237 + e007035 commit 680d739
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ class Book < ActiveRecord::Base
def self.allowed(object, subject)
rules = []
return rules unless book.instance_of?(Book)
return rules unless subject.instance_of?(Book)
rules << :read_book if subject.public?
rules << :edit_book if object && object.id == subject.author_id
rules
end
end
# View
link_to 'Edit', edit_book_path(book) if can?(@author, :edit_book, book)
link_to 'Edit', edit_book_path(book) if can?(@author, :edit_book, @book)
```
### Ruby Usage
Expand Down

0 comments on commit 680d739

Please sign in to comment.