Easily add named timestamp scopes
http://github.com/jakeonrails/timestamp_scopes
# Allows you to do this:
class Post < ActiveRecord::Base
add_timestamp_scopes
...
recent_posts = Post.created(after: 1.hour.ago)
old_posts = Post.created(before: 1.week.ago)
Written by Jake Moffatt
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#