Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Named instances for Rails

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 named_instances.gemspec
README.rdoc

Named Instances

Provides support for named instances in Rails.

Quick usage:

class Diagnosis < ActiveRecord::Base
  has_named_instances :name
end

Diagnosis.create :name => "Diabetes Mellitus"

>> Diagnosis.get(:diabetes_mellitus)
=> #<Diagnosis id: 52, name: "Diabetes Mellitus", created_at: "2009-10-07 15:41:50", updated_at: "2009-10-07 15:41:50">

Patches welcome, enjoy!

Copyright

Copyright © 2009 - 2010 Jason Dew. See LICENSE for details.

Something went wrong with that request. Please try again.