From 5afb97b5f7e278a3f1e2b59241f1551cd9c40fbc Mon Sep 17 00:00:00 2001 From: maxwell Date: Sat, 19 Jun 2010 00:49:35 -0700 Subject: [PATCH] dashboard controller stopped resolving, but the old behavior seems to work now...nnot sure why, could have been mongoid bug... --- app/controllers/dashboard_controller.rb | 3 ++- app/models/friend.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 7196b7fb5..f1fe520ea 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -4,7 +4,8 @@ class DashboardController < ApplicationController include ApplicationHelper def index - @posts = Post.stream + posts = Post.all.order_by( [:created_at, :desc] ) + @posts = posts end diff --git a/app/models/friend.rb b/app/models/friend.rb index 69b60fd36..d7c45c132 100644 --- a/app/models/friend.rb +++ b/app/models/friend.rb @@ -9,7 +9,7 @@ class Friend field :url validates_presence_of :username, :url - validates_format_of :url, :with => + givalidates_format_of :url, :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix before_validation :clean_url