Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 14 lines (8 sloc) 0.737 kb

Boolean datetime attribute

What is boolean attribute?

This plugin allows you to replace boolean columns with datetime columns. For example, you have a User model with the "inactive" boolean column. Why not make it more informative and change that column to "inactive_at"? Now you know when the user was marked inactive. This plugin allows you to do that and still get all of the methods that you would have for a boolean column. It's transparent, you can treat it as a boolean, but it will store it as a date.

How it works

class User < ActiveRecord::Base
    boolean_datetime_attribute :inactive_at
end

Copyright (c) 2007 Ben Johnson of Binary Logic, released under the MIT license

Something went wrong with that request. Please try again.