ActiveRecord::Base.class_eval do
  def self.created_within(from, to)
    scoped :conditions => [ "`#{table_name}`.`created_at` BETWEEN ? AND ?", from, to ]
  end
end
