Skip to content

angelo0000/has_duration_field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HasDurationField
================
!! HasDurationField requires the proxy_field plugin !!
Install proxy_field
./script/plugin install git://github.com/angelo0000/proxy_field.git


Install HadDurationField
./script/plugin install git://github.com/angelo0000/has_duration_field.git

Provideds ability to wrap ActiveRecord column(s) with a DurationField
object.

Example
=======

class WaitingRoom < ActiveRecord::Base
  has_duration_field :duration
  #also valid:
  # has_duration_field [:col1, :col2]
end

This will automatically return a DurationField object when you call .duration
on an instance of WaitingRoom. You get the following methods on the returned
object:

.to_seconds
.to_minutes
.to_hours
.to_days
.to_weeks
.to_years


Copyright (c) 2009 StarterStep, released under the MIT license

About

Proxies an ActiveRecord column(s) with a DurationField

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages