README.md in mongoid_rating-0.0.2 vs README.md in mongoid_rating-0.1.0
- old
+ new
@@ -32,10 +32,12 @@
make model rateable:
class Post
include Mongoid::Document
rateable :rate
+ # needed if you use rails_admin so it would not complain
+ accepts_nested_attributes_for :rate_data
end
ps = Post.create()
user = User.create()
rate and unrate:
@@ -55,10 +57,11 @@
ps.rate_by?(user)
=> true
Scopes:
+ Post.highest_rate
Post.rate_in(2..5)
Post.rate_in(2..5).first
=> #<Post rate_count: 1, rate_sum: 5.0, rate_average: 5.0>
Post.rate_in(2..3).first
=> nil
@@ -71,10 +74,10 @@
## Credits
(c) 2013 glebtv, MIT license
Partially based on
-(mongoid-rateable)[https://github.com/proton/mongoid_rateable]
+[mongoid-rateable](https://github.com/proton/mongoid_rateable)
which is Copyright (c) 2011 Peter Savichev (proton), MIT license
## Contributing
1. Fork it