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)
Conteúdo para você se capacitar em programação
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)