Plugins - Candidate Keys
Add to favoritesAlters find to include candidate keys of one’s own design. Useful when combined with to_param.
class Books < ActiveRecord::Base
on_candidate_keys :find_by_isbn
def to_param
read_attribute :isbn
end
end
Book.find("0977616630")
