No commit activity in last 3 years
No release in over 3 years
ActiveRecord plugin for creating a boolean virtual attribute from a datetime column.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.11
~> 1.3
~> 0.4

Runtime

 Project Readme

BooleTime

ActiveRecord plugin for creating a boolean virtual attribute and scopes from a date or datetime column.

Getting Started

# Gemfile
gem 'boole_time'
$ bundle install
$ rails generate model Post published_at:datetime
# Or any model with a datetime column
# app/models/post.rb
class Post < ActiveRecord::Base
  boole_time :published_at
end

# elsewhere
post = Post.new
post.published = true
post.published_at
# => (Time.now)
post.published = false
post.published_at
# => nil

Copyright

Copyright (c) 2012 Pete Browne. See LICENSE for details.