From b5023154da98e95f85a16bd82132f861cf33142c Mon Sep 17 00:00:00 2001 From: Mark Cottman-Fields Date: Wed, 31 Oct 2012 12:07:45 +1000 Subject: [PATCH] updated devise config --- app/controllers/application_controller.rb | 5 ++--- app/models/user.rb | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c784546d..49df37cb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,8 +7,7 @@ class ApplicationController < ActionController::Base private def set_stamper - # BUG: I expect this to fail - # TODO: hack while we have no authentication - User.stamper = User.first() #self.current_user + # current_user is provided by devise + User.stamper = self.current_user end end diff --git a/app/models/user.rb b/app/models/user.rb index 14cf8401..11afe20d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,4 +16,5 @@ class User < ActiveRecord::Base # validation validates_presence_of :display_name validates_uniqueness_of :display_name, :email, :case_sensitive => false + has_friendly_id :display_name, :use_slug => true, :strip_non_ascii => true end