This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Provides simple macro to define all methods you may potentially need to fully use Rails to_param mechanism.
License
szajbus/to_param
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ToParam ======= ToParam plugin provides simple macro to define all methods you may potentially need to fully use to_param mechanism. Intended but not limited to work with Ruby on Rails and ActiveRecord. Installation ============ script/plugin install git://github.com/szajbus/to_param.git Example ======= class Article < Active::Record to_param :slug end The code above is equivalent to: class Article < Active::Record def to_param slug end def self.find_by_param(*args) find_by_slug(args) end def self.find_by_param!(*args) find_by_slug!(args) end def self.find_all_by_param(*args) find_all_by_slug(args) end def self.find_all_by_param!(*args) find_all_by_slug!(args) end end So this plugin is just a time-and-space-saver, not much magic here. Copyright (c) 2009 Michał Szajbe, released under the MIT license
About
Provides simple macro to define all methods you may potentially need to fully use Rails to_param mechanism.
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published