
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
arturop-autocomplete_for
Advanced tools
This plugin implements model-side logic for autocompleting belongs_to associations. It handles validations, autocompleting the same association via different fields (say name or login) and the ability to specify a custom finder block.
It works out-of-the-box with existing front-end autocompletion solutions because all it does is set the value of the belongs_to association based on an attribute that can be set directly or via update_attributes (see examples below.)
class Author < ActiveRecord::Base
# has a login and open_id column
end
class Post < ActiveRecord::Base
belongs_to :author
# set the author_login field to autocomplete by author login
autocomplete_for :author, :login do
self.author = Author.find(:first, :conditions => {:login => @author_login})
end
# set the author_open_id field to autocomplete by author open_id
autocomplete_for :author, :open_id do
self.author = Author.find(:first, :conditions => {:open_id => @author_open_id})
end
end
Using autocomplete_for in your models to set belongs_to associations:
author = Author.create! :login => 'baz'
post = Post.create! :author_login => 'baz' # automatically finds the author with the login 'baz'
puts post.author.login # will output 'baz'
Errors are generated automatically if the given information does not correspond to a valid model:
author = Author.create! :login => 'baz'
post = Post.create :author_login => 'quux'
puts post.errors[:author_login] # will print an error message
Copyright (c) 2010 Nulogy Corporation, released under the MIT license
FAQs
Unknown package
We found that arturop-autocomplete_for 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.