Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Powered by: acts_as_indexed and refinerycms-acts-as-indexed - Check his readme and documentation for more info on how it works.
Simply use this by adding the following to your Gemfile
:
gem 'refinerycms-search', '~> 2.1.0'
Now, run bundle install
Next, to install the search plugin run:
rails generate refinery:search
Run database migrations:
rake db:migrate
Finally seed your database and you're done.
rake db:seed
A sample search form can be found in views/refinery/shared/_search.html.erb. You can either use this partial directly, or copy the appropriate parts.
The default installation will search in Pages.
If you wish to find results in other plugins you have created or installed, you can specify these in config/application.rb
like so:
config.to_prepare do
Refinery.searchable_models = [Refinery::Page]
end
Simply add any additional models you wish to search to this array. For example, if you have the portfolio plugin installed:
config.to_prepare do
Refinery.searchable_models = [Refinery::Page, Refinery::PortfolioEntry]
end
The above line will add indexing to PortfolioEntry in the portfolio plugin, which does not come indexed.
Any model you wish to search will need to be indexed using acts as indexed. To add indexing, simple add:
acts_as_indexed :fields => [:title, :body]
If your model doesn't use a :title
attribute, remember to add an alias_attribute
:
alias_attribute :title, :name #for example
You can use any public method, as well. So if you have :first_name
and :last_name
but a method like name
to join them, it can be indexed.
acts_as_indexed :fields => [:name, :biography]
#...
def name
[first_name, last_name].reject(&:blank?).join(' ')
end
You will need to replace the indexed fields with those appropriate for your model.
If you wish to override the url used in the search results just add a url
method to your model and the result of this method will be used instead.
Just define the method friendly_search_name
to override what is displayed
for each search result for your model as per the implementing pull request.
def friendly_search_name
"Document"
end
FAQs
Unknown package
We found that refinerycms-search demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.