Skip to content

petebrowne/boole_time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

ActiveRecord plugin for creating a boolean virtual attribute from a datetime column.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages