atnan / pretty_times

Rails plugin for adding *_in_words methods to models for use when serialising records with datetime attributes.

This URL has Read+Write access

atnan (author)
Mon Sep 29 03:46:50 -0700 2008
name age message
file MIT-LICENSE Loading commit data...
file README
file init.rb
directory lib/
README
PrettyTimes
===========

This is a simple plugin which adds human formatted date attributes to your
models so that the attributes can be serialised as JSON/XML easily.


Example
=======

class Post < ActiveRecord::Base
  pretty_times :created_at, :updated_at
end

Post.first.created_at_in_words
=> "4 days ago"

Copyright (c) 2008 Nathan de Vries (http://www.atnan.com), released under the MIT license