No commit activity in last 3 years
No release in over 3 years
acts as param
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme
ActsAsParam
===========

Example
=======

// In you model
class Product
  acts_as_param :name, :serial
end

// How To Use
product = Product.create(:name => 'name',:serial => 'serial'}
product.to_param == 'name'

product = Product.create(:name => nil,:serial => 'serial'}
product.to_param == 'serial'

product = Product.create(:name => nil,:serial => nil}
product.to_param == product.id

product.find_by_param('serial') # find by product's serial
product.find_by_param('name')   # find by product's name
product.find_by_param(2)        # find by Product's primary key

product.find_by_param!('serial') # raise ActiveRecord::RecordNotFound exception if not found


Copyright (c) 2010 Jinzhu / wosmvp@gmail.com, released under the MIT license