Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Add this line to your application's Gemfile:
gem 'mongoid_rating'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mongoid_rating
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:
ps.rate 5, user
ps.unrate, user
Get current rating
ps.rate
=> 5.0
ps.rate_by(user)
=> 5
Check if user rated:
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
Posts rated by user:
Post.rate_by(user).first
=> #<Post rate_count: 1, rate_sum: 5.0, rate_average: 5.0>
(c) 2013 glebtv, MIT license
Partially based on mongoid-rateable which is Copyright (c) 2011 Peter Savichev (proton), MIT license
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that mongoid_rating demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.