# Telescope ## Installation Add this line to your application's Gemfile: gem 'telescope' And then execute: $ bundle Or install it yourself as: $ gem install telescope ## Usage ```ruby create_table "events" do |t| t.string "name" t.boolean "special" t.datetime "expired_at" end class Event < ActiveRecord::Base acts_as_telescope end Event.special # SELECT * FROM `events` where `events`.`special` = 1 Event.not_special # SELECT * FROM `events` where `events`.`special` = 0 Time.now # => 2013-07-05 15:43:42 Event.expired_before(2.months.ago) # SELECT * FROM `events` where `events`.`expired_at` < '2013-05-05 15:43:42' Event.expired_before_now # SELECT * FROM `events` where `events`.`expired_at` < '2013-07-05 15:43:42' Event.expired_after_or_at(2.months.from_now) # SELECT * FROM `events` where `events`.`expired_at` >= '2013-09-05 15:43:42' Event.expired_between(2.months.ago..1.month.from_now) # SELECT * FROM `events` where `events`.`expired_at` BETWEEN '2013-05-05 15:43:42' AND '2013-08-05 15:43:42' ```