ActiveRecord Default Options plugin

Plugin details

Add default option to your model's #find method. Simple, unintrusive, powerful.

Websitehttp://6brand.com/ Repositoryhttp://svn.6brand.com/projects/plugins/ar_default_options/ Author Danger Tags default, option LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://svn.6brand.com/projects/plugins/ar_default_options/

Example

Person.default_find_option :order, :age
# we can also do it this way:
class Person < ActiveRecord::Base
  default_find_option :conditions, "gender = 'Female'"
end
# let's check that that actually did something:
Person.instance_variable_get "@default_find_options"
# => {:conditions=>"gender = 'Female'", :order=>:age} 


Further Documentation

Edit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago