# HG changeset patch # User luisf # Date 1291634103 0 # Node ID 9d42bcda8cea2212e9759fd8cebcb4611cc84cd8 # Parent b5bd39e2765895430eac3934c752d5a6eb7fc8fe Validation of description fields (INCOMPLETE: error messages are not displayed correctly) diff -r b5bd39e27658 -r 9d42bcda8cea app/models/ssamr_user_detail.rb --- a/app/models/ssamr_user_detail.rb Fri Dec 03 13:14:12 2010 +0000 +++ b/app/models/ssamr_user_detail.rb Mon Dec 06 11:15:03 2010 +0000 @@ -1,3 +1,5 @@ class SsamrUserDetail < ActiveRecord::Base belongs_to :user + + validates_presence_of :description end diff -r b5bd39e27658 -r 9d42bcda8cea app/models/user.rb --- a/app/models/user.rb Fri Dec 03 13:14:12 2010 +0000 +++ b/app/models/user.rb Mon Dec 06 11:15:03 2010 +0000 @@ -52,7 +52,7 @@ belongs_to :auth_source has_one :ssamr_user_detail, :dependent => :destroy, :class_name => 'SsamrUserDetail' - + # Active non-anonymous users scope named_scope :active, :conditions => "#{User.table_name}.status = #{STATUS_ACTIVE}" diff -r b5bd39e27658 -r 9d42bcda8cea app/views/account/register.rhtml --- a/app/views/account/register.rhtml Fri Dec 03 13:14:12 2010 +0000 +++ b/app/views/account/register.rhtml Mon Dec 06 11:15:03 2010 +0000 @@ -3,6 +3,12 @@ <% form_tag({:action => 'register'}, :class => "tabular") do %> <%= error_messages_for 'user' %> + +
<% if @user.auth_source_id.nil? %>