Plugins - Candidate Keys

StarAdd to favorites

Alters 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")

Tim Pope

http://svn.tpope.net/rails/plugins/candidate_keys

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?