![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
This is a small Ruby on Rails plugin that can be installed as a gem in your Gemfile
that allows models to attach to it to provide spam filtering functionality.
Add to your Gemfile:
gem 'filters_spam', '~> 0.4'
Run bundle install
.
Once you have the plugin installed, you need to add a column to the table you will be
using this for. For example, if you have a table called comments
:
script/generate migration add_spam_to_comments spam:boolean
rake db:migrate
The same thing in Rails 3:
rails generate migration add_spam_to_comments spam:boolean
rake db:migrate
Now, you can use it by calling the function in your model like so:
filters_spam
If you want to change the default fields that are used by filters_spam
then you can pass them in to the method as options. All options are optional.
All of the possible options are outlined below with the default values for each:
filters_spam({
:message_field => :message,
:email_field => :email,
:author_field => :author,
:other_fields => [],
:extra_spam_words => %w()
})
So, say you wanted to mark 'ruby' and 'rails' as spam words you simply pass them
in using the :extra_spam_words
option:
filters_spam({
:extra_spam_words => %w(ruby rails)
})
Enjoy a life with less spam.
This code was inspired by Russel Norris' acts_as_snook plugin and ideas presented by Jonathan Snook
FAQs
Unknown package
We found that filters_spam demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.