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.
An active record bookmark system developed using ruby on rails applying domain driven design and test driven development principles.
For rails 4 support use branch v0.0.7-stable.
For rails 5 support use branch v0.1.1-stable.
This gem is heavily influenced by cmer/socialization.
Add this line to your application's Gemfile:
gem 'bookmark_system'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bookmark_system
$ rails g bookmark_system
Let's suppose for a moment that you have a blog application and a User can bookmark a Post or several Post models. The user model becomes the bookmarker and the post model becomes the bookmarkee.
class Post < ActiveRecord::Base
act_as_bookmarkee
validates :content, presence: true
end
class User < ActiveRecord::Base
act_as_bookmarker
validates :username, { presence: true, uniqueness: true }
end
post.is_bookmarkee? # returns true
post.bookmarked_by?(user) # returns true if user bookmarks the post object, false otherwise
post.bookmarkers_by(User) # returns a scope of BookmarkSystem::Bookmark join model that belongs to the post object and belongs to bookmarker objects of type User
user.is_bookmarker? # returns true
user.bookmark(post) # Creates an instance of BookmarkSystem::Bookmark join model associating the user object and the post object, returns true if succeded, false otherwise
user.unbookmark(post) # Destroys an instance of BookmarkSystem::Bookmark join model that associates the user object and the post object, returns true if succeded, false otherwise
user.toggle_bookmark(post) # Bookmarks / unbookmarks the post
user.bookmarks?(post) # returns true if the user object bookmarks the post object, false otherwise
user.bookmarkees_by(Post) # returns a scope of BookmarkSystem::Bookmark join model that belongs to the user object and belongs to bookmarkee objects of type Post
For more information read the api documentation.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that bookmark_system 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.