# HG changeset patch
# User Chris Cannam
# Date 1292493800 0
# Node ID 432bb11e0390f69157d8801997ad679ebe310997
# Parent 8a49eabbb30aee49704489881d1a517a46787775# Parent 387ad4f406867f6c3a950c7a77fc04f6865e38d2
Merge from branch "luisf"
diff -r 8a49eabbb30a -r 432bb11e0390 app/controllers/account_controller.rb
--- a/app/controllers/account_controller.rb Tue Dec 14 14:05:06 2010 +0000
+++ b/app/controllers/account_controller.rb Thu Dec 16 10:03:20 2010 +0000
@@ -77,13 +77,19 @@
# User self-registration
def register
redirect_to(home_url) && return unless Setting.self_registration? || session[:auth_source_registration]
+
if request.get?
session[:auth_source_registration] = nil
@user = User.new(:language => Setting.default_language)
+
+ @ssamr_user_details = SsamrUserDetail.new
+
else
@user = User.new(params[:user])
@user.admin = false
+
@user.register
+
if session[:auth_source_registration]
@user.activate
@user.login = session[:auth_source_registration][:login]
@@ -98,6 +104,11 @@
@user.login = params[:user][:login]
@user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
+ @ssamr_user_details = SsamrUserDetail.new(params[:ssamr_user_details])
+
+ # associates the 2 objects
+ @user.ssamr_user_detail = @ssamr_user_details
+
case Setting.self_registration
when '1'
register_by_email_activation(@user)
@@ -257,6 +268,9 @@
# Pass a block for behavior when a user fails to save
def register_manually_by_administrator(user, &block)
if user.save
+
+ @ssamr_user_details.save!
+
# Sends an email to the administrators
Mailer.deliver_account_activation_request(user)
account_pending
diff -r 8a49eabbb30a -r 432bb11e0390 app/controllers/issues_controller.rb
--- a/app/controllers/issues_controller.rb Tue Dec 14 14:05:06 2010 +0000
+++ b/app/controllers/issues_controller.rb Thu Dec 16 10:03:20 2010 +0000
@@ -132,7 +132,19 @@
attachments = Attachment.attach_files(@issue, params[:attachments])
render_attachment_warning_if_needed(@issue)
flash[:notice] = l(:notice_successful_create)
+
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
+
+ # Adds user to watcher's list
+ @issue.add_watcher(User.current)
+
+ # Also adds the assignee to the watcher's list
+ if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?:
+ unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]):
+ @issue.add_watcher(User.find(params[:issue][:assigned_to_id]))
+ end
+ end
+
respond_to do |format|
format.html {
redirect_to(params[:continue] ? { :action => 'new', :project_id => @project, :issue => {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} } :
@@ -274,6 +286,18 @@
@notes = params[:notes] || (params[:issue].present? ? params[:issue][:notes] : nil)
@issue.init_journal(User.current, @notes)
@issue.safe_attributes = params[:issue]
+
+ # tests if the the user assigned_to_id
+ # is in this issues watcher's list
+ # if not, adds it.
+
+ if params[:issue][:assigned_to_id] && !params[:issue][:assigned_to_id].empty?:
+ unless @issue.watcher_ids.include?(params[:issue][:assigned_to_id]):
+ @issue.add_watcher(User.find(params[:issue][:assigned_to_id]))
+ end
+ end
+
+
end
# TODO: Refactor, lots of extra code in here
diff -r 8a49eabbb30a -r 432bb11e0390 app/controllers/users_controller.rb
--- a/app/controllers/users_controller.rb Tue Dec 14 14:05:06 2010 +0000
+++ b/app/controllers/users_controller.rb Thu Dec 16 10:03:20 2010 +0000
@@ -52,6 +52,8 @@
def show
@user = User.find(params[:id])
+ @description = @user.ssamr_user_detail.description
+
# show projects based on current user visibility
@memberships = @user.memberships.all(:conditions => Project.visible_by(User.current))
@@ -70,12 +72,15 @@
render_404
end
- def new
+ def new
@notification_options = User::MAIL_NOTIFICATION_OPTIONS
@notification_option = Setting.default_notification_option
@user = User.new(:language => Setting.default_language)
@auth_sources = AuthSource.find(:all)
+
+ @ssamr_user_details = SsamrUserDetail.new
+
end
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
@@ -83,7 +88,7 @@
@notification_options = User::MAIL_NOTIFICATION_OPTIONS
@notification_option = Setting.default_notification_option
- @user = User.new(params[:user])
+ @user = User.new(params[:user])
@user.admin = params[:user][:admin] || false
@user.login = params[:user][:login]
@user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless @user.auth_source_id
@@ -93,8 +98,16 @@
@user.pref.attributes = params[:pref]
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
+ @ssamr_user_details = SsamrUserDetail.new(params[:ssamr_user_details])
+
+ # associates the 2 objects
+ @user.ssamr_user_detail = @ssamr_user_details
+
if @user.save
@user.pref.save
+
+ @ssamr_user_details.save!
+
@user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : [])
Mailer.deliver_account_information(@user, params[:password]) if params[:send_information]
@@ -114,7 +127,9 @@
@user = User.find(params[:id])
@notification_options = @user.valid_notification_options
@notification_option = @user.mail_notification
-
+
+ @ssamr_user_details = @user.ssamr_user_detail
+
@auth_sources = AuthSource.find(:all)
@membership ||= Member.new
end
@@ -122,6 +137,7 @@
verify :method => :put, :only => :update, :render => {:nothing => true, :status => :method_not_allowed }
def update
@user = User.find(params[:id])
+
@notification_options = @user.valid_notification_options
@notification_option = @user.mail_notification
@@ -139,6 +155,14 @@
@user.pref.attributes = params[:pref]
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
+ @ssamr_user_details = @user.ssamr_user_detail
+ if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty?
+ @ssamr_user_details.description = @user.ssamr_user_detail.description
+ else
+ @ssamr_user_details.description = params[:ssamr_user_details][:description]
+ @ssamr_user_details.save!
+ end
+
if @user.save
@user.pref.save
@user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : [])
diff -r 8a49eabbb30a -r 432bb11e0390 app/helpers/projects_helper.rb
--- a/app/helpers/projects_helper.rb Tue Dec 14 14:05:06 2010 +0000
+++ b/app/helpers/projects_helper.rb Thu Dec 16 10:03:20 2010 +0000
@@ -83,6 +83,113 @@
s
end
+
+ # Renders a tree of projects where the current user belongs
+ # as a nested set of unordered lists
+ # The given collection may be a subset of the whole project tree
+ # (eg. some intermediate nodes are private and can not be seen)
+ def render_my_project_hierarchy(projects)
+ s = ''
+
+ a = ''
+
+ # Flag to tell if user has any projects
+ t = FALSE
+
+ if projects.any?
+ ancestors = []
+ original_project = @project
+ projects.each do |project|
+ # set the project environment to please macros.
+
+ @project = project
+
+ if User.current.member_of?(project):
+
+ t = TRUE
+
+ if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
+ s << "
\n"
+ else
+ ancestors.pop
+ s << ""
+ while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
+ ancestors.pop
+ s << " \n"
+ end
+ end
+
+ classes = (ancestors.empty? ? 'root' : 'child')
+ s << "" +
+ link_to_project(project, {}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}")
+ s << "
#{textilizable(project.short_description, :project => project)}
" unless project.description.blank?
+ s << "
\n"
+ ancestors << project
+ end
+ end
+ s << (" \n" * ancestors.size)
+ @project = original_project
+ end
+
+ if t == TRUE
+ a << ""
+ a << l("label_my_project_plural")
+ a << " "
+ a << s
+ else
+ a = s
+ end
+
+ a
+ end
+
+ # Renders a tree of projects where the current DOES NOT belong
+ # as a nested set of unordered lists
+ # The given collection may be a subset of the whole project tree
+ # (eg. some intermediate nodes are private and can not be seen)
+ def render_other_project_hierarchy(projects)
+ s = ''
+
+ if projects.any?
+ ancestors = []
+ original_project = @project
+ projects.each do |project|
+ # set the project environment to please macros.
+
+ @project = project
+
+ if not User.current.member_of?(project):
+
+ if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
+ s << "\n"
+ else
+ ancestors.pop
+ s << ""
+ while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
+ ancestors.pop
+ s << " \n"
+ end
+ end
+
+ classes = (ancestors.empty? ? 'root' : 'child')
+ s << "" +
+ link_to_project(project, {}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}")
+ s << "
#{textilizable(project.short_description, :project => project)}
" unless project.description.blank?
+ s << "
\n"
+ ancestors << project
+ end
+ end
+
+ s << (" \n" * ancestors.size)
+ @project = original_project
+ end
+
+
+ s
+ end
+
+
+
# Returns a set of options for a select field, grouped by project.
def version_options_for_select(versions, selected=nil)
grouped = Hash.new {|h,k| h[k] = []}
diff -r 8a49eabbb30a -r 432bb11e0390 app/models/ssamr_user_detail.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/app/models/ssamr_user_detail.rb Thu Dec 16 10:03:20 2010 +0000
@@ -0,0 +1,5 @@
+class SsamrUserDetail < ActiveRecord::Base
+ belongs_to :user
+
+ validates_presence_of :description
+end
diff -r 8a49eabbb30a -r 432bb11e0390 app/models/user.rb
--- a/app/models/user.rb Tue Dec 14 14:05:06 2010 +0000
+++ b/app/models/user.rb Thu Dec 16 10:03:20 2010 +0000
@@ -51,6 +51,9 @@
has_one :api_token, :dependent => :destroy, :class_name => 'Token', :conditions => "action='api'"
belongs_to :auth_source
+ has_one :ssamr_user_detail, :dependent => :destroy, :class_name => 'SsamrUserDetail'
+ accepts_nested_attributes_for :ssamr_user_detail
+
# Active non-anonymous users scope
named_scope :active, :conditions => "#{User.table_name}.status = #{STATUS_ACTIVE}"
@@ -62,6 +65,9 @@
attr_protected :login, :admin, :password, :password_confirmation, :hashed_password, :group_ids
validates_presence_of :login, :firstname, :lastname, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
+
+ # TODO: is this validation correct validates_presence_of :ssamr_user_detail
+
validates_uniqueness_of :login, :if => Proc.new { |user| !user.login.blank? }, :case_sensitive => false
validates_uniqueness_of :mail, :if => Proc.new { |user| !user.mail.blank? }, :case_sensitive => false
# Login must contain lettres, numbers, underscores only
@@ -92,6 +98,10 @@
write_attribute(:mail, arg.to_s.strip)
end
+ def description=(arg)
+ write_attribute(:description, arg.to_s.strip)
+ end
+
def identity_url=(url)
if url.blank?
write_attribute(:identity_url, '')
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/account/register.rhtml
--- a/app/views/account/register.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/account/register.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -29,6 +29,23 @@
<%=l(:field_language)%>
<%= select("user", "language", lang_options_for_select) %>
+
+<%=l(:label_ssamr_details)%>
+
+ <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %>
+
+
+ <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %>
+ <%= wikitoolbar_for 'ssamr_user_details_description' %>
+
+
+ <%=l(:text_user_ssamr_description_info)%>
+
+ <% end %>
+
+
+
+
<% if Setting.openid? %>
<%=l(:field_identity_url)%>
<%= text_field 'user', 'identity_url' %>
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/issues/_form.rhtml
--- a/app/views/issues/_form.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/issues/_form.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -9,9 +9,12 @@
<%= f.text_field :subject, :size => 80, :required => true %>
<% if User.current.allowed_to?(:manage_subtasks, @project) %>
-<%= f.text_field :parent_issue_id, :size => 10 %>
-
-<%= javascript_tag "observeParentIssueField('#{auto_complete_issues_path(:id => @issue, :project_id => @project) }')" %>
+ <%= f.text_field :parent_issue_id, :size => 10, :autocomplete => :on %>
+
+ <%=l(:text_issue_parent_issue_info)%>
+
+
+ <%= javascript_tag "observeParentIssueField('#{auto_complete_issues_path(:id => @issue, :project_id => @project) }')" %>
<% end %>
<%= f.text_area :description,
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/mailer/account_activation_request.text.html.rhtml
--- a/app/views/mailer/account_activation_request.text.html.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/mailer/account_activation_request.text.html.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -1,2 +1,12 @@
<%= l(:mail_body_account_activation_request, h(@user.login)) %>
<%= link_to @url, @url %>
+
+<%= l(:label_ssamr_details) %>
+
+ <%=l(:field_name)%>: <%= h @user.name %>
+ <%=l(:field_mail)%>: <%= h @user.mail %>
+
+
+<%= l(:label_ssamr_description ) %>
+<%= textilizable @user.ssamr_user_detail['description'] %>
+
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/mailer/account_activation_request.text.plain.rhtml
--- a/app/views/mailer/account_activation_request.text.plain.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/mailer/account_activation_request.text.plain.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -1,2 +1,11 @@
<%= l(:mail_body_account_activation_request, @user.login) %>
<%= @url %>
+
+*<%= l(:label_ssamr_details) %>*
+<%=l(:field_name)%>: <%= h @user.name %>
+<%=l(:field_mail)%>: <%= h @user.mail %>
+
+*<%= l(:label_ssamr_description ) %>*
+<%= h @user.ssamr_user_detail['description'] %>
+
+
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/projects/_form.rhtml
--- a/app/views/projects/_form.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/projects/_form.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -2,7 +2,10 @@
-
<%= f.text_field :name, :required => true, :size => 60 %>
+
<%= f.text_field :name, :required => true, :size => 60 %>
+
+ <%= l(:text_project_name_info) %>
+
<% unless @project.allowed_parents.compact.empty? %>
<%= label(:project, :parent_id, l(:field_parent)) %><%= parent_project_select_tag(@project) %>
@@ -11,10 +14,17 @@
<%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %>
<%= f.text_field :identifier, :required => true, :size => 60, :disabled => @project.identifier_frozen? %>
<% unless @project.identifier_frozen? %>
-<%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info) %>
+
+ <%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info) %>
<% end %>
-
<%= f.text_field :homepage, :size => 60 %>
-
<%= f.check_box :is_public %>
+
<%= f.text_field :homepage, :size => 60 %>
+
+ <%= l(:text_project_homepage_info) %>
+
+
<%= f.check_box :is_public %>
+
+ <%= l(:text_project_visibility_info) %>
+
<%= wikitoolbar_for 'project_description' %>
<% @project.custom_field_values.each do |value| %>
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/projects/index.rhtml
--- a/app/views/projects/index.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/projects/index.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -9,9 +9,20 @@
<%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%>
-<%=l(:label_project_plural)%>
+<% if User.current.logged? %>
+
+ <%= render_my_project_hierarchy(@projects)%>
-<%= render_project_hierarchy(@projects)%>
+ <%=l(:label_other_project_plural)%>
+ <%= render_other_project_hierarchy(@projects)%>
+
+<% else %>
+
+ <%=l(:label_project_plural)%>
+ <%= render_project_hierarchy(@projects)%>
+<% end %>
+
+
<% if User.current.logged? %>
@@ -19,6 +30,7 @@
<% end %>
+
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<% end %>
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/projects/settings/_members.rhtml
--- a/app/views/projects/settings/_members.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/projects/settings/_members.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -13,19 +13,18 @@
<% members.each do |member| %>
- <% next if member.new_record? %>
-
- <%= link_to_user member.principal %>
-
- <%=h member.roles.sort.collect(&:to_s).join(', ') %>
- <% if authorize_for('members', 'edit') %>
- <% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member},
- :method => :post,
- :html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }) do |f| %>
- <% roles.each do |role| %>
- <%= check_box_tag 'member[role_ids][]', role.id, member.roles.include?(role),
+ <% next if member.new_record? %>
+
+ <%= link_to_user member.principal %>
+
+ <%=h member.roles.sort.collect(&:to_s).join(', ') %>
+ <% if authorize_for('members', 'edit') %>
+ <% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member},
+ :method => :post, :html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }) do |f| %>
+ <% roles.each do |role| %>
+ <%= check_box_tag 'member[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %>
- <% end %>
+ <% end %>
<%= hidden_field_tag 'member[role_ids][]', '' %>
<%= submit_tag l(:button_change), :class => "small" %>
<%= link_to_function l(:button_cancel), "$('member-#{member.id}-roles').show(); $('member-#{member.id}-roles-form').hide(); return false;" %>
@@ -51,7 +50,7 @@
-<% principals = Principal.active.find(:all, :limit => 100, :order => 'type, login, lastname ASC') - @project.principals %>
+<% principals = Principal.active.find(:all, :limit => 10, :order => 'type, login, lastname ASC') - @project.principals %>
<% if roles.any? && principals.any? %>
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/users/_form.rhtml
--- a/app/views/users/_form.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/users/_form.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -20,6 +20,20 @@
+
<%=l(:label_ssamr_details)%>
+ <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %>
+
+ <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %>
+ <%= wikitoolbar_for 'ssamr_user_details_description' %>
+
+ <%=l(:text_user_ssamr_description_info)%>
+
+ <% end %>
+
+
+
+
+
<%=l(:label_authentication)%>
<% unless @auth_sources.empty? %>
<%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {Element.show('password_fields');} else {Element.hide('password_fields');}" %>
diff -r 8a49eabbb30a -r 432bb11e0390 app/views/users/show.rhtml
--- a/app/views/users/show.rhtml Tue Dec 14 14:05:06 2010 +0000
+++ b/app/views/users/show.rhtml Thu Dec 16 10:03:20 2010 +0000
@@ -20,6 +20,10 @@
<% end %>
+
<%=l(:label_ssamr_description)%>
+<%= textilizable @description %>
+
+
<% unless @memberships.empty? %>
<%=l(:label_project_plural)%>
diff -r 8a49eabbb30a -r 432bb11e0390 config/locales/en.yml
--- a/config/locales/en.yml Tue Dec 14 14:05:06 2010 +0000
+++ b/config/locales/en.yml Thu Dec 16 10:03:20 2010 +0000
@@ -200,7 +200,9 @@
gui_validation_error: 1 error
gui_validation_error_plural: "{{count}} errors"
-
+
+ field_ssamr_user_detail:
+ description: User Description
field_name: Name
field_description: Description
field_summary: Summary
@@ -299,11 +301,12 @@
field_text: Text field
field_visible: Visible
+ setting_tipoftheday_text: Tip of the Day
+ setting_notifications_text: Notifications
+ label_ssamr_description: Description
setting_app_title: Application title
setting_app_subtitle: Application subtitle
setting_welcome_text: Welcome text
- setting_tipoftheday_text: Tip of the Day
- setting_notifications_text: Notifications
setting_default_language: Default language
setting_login_required: Authentication required
setting_self_registration: Self-registration
@@ -425,6 +428,7 @@
project_module_gantt: Gantt
label_tipoftheday: Tip of the day
+ label_ssamr_details: Other Details
label_user: User
label_user_plural: Users
label_user_new: New user
@@ -432,6 +436,8 @@
label_project: Project
label_project_new: New project
label_project_plural: Projects
+ label_my_project_plural: My Projects
+ label_other_project_plural: Other Projects
label_x_projects:
zero: no projects
one: 1 project
@@ -859,7 +865,12 @@
text_tip_issue_begin_day: issue beginning this day
text_tip_issue_end_day: issue ending this day
text_tip_issue_begin_end_day: issue beginning and ending this day
- text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed. Once saved, the identifier can not be changed.'
+ text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed. This will be used in all project-related URLs, and as the repository name. Once saved, the identifier can not be changed.'
+ text_project_name_info: "This will be the name of your project throughout this site. You can change your project's name at any time, in the project's settings."
+ text_project_visibility_info: "If your project is not public, it will only be visible to users that you have added as project members."
+ text_project_homepage_info: 'Link to an external project page.'
+ text_user_ssamr_description_info: 'Description of your interests and experience as a Researcher/Developer in the field of Audio and Music.'
+ text_issue_parent_issue_info: 'If this is a subtask, please insert its parent task number or write the main task name.'
text_caracters_maximum: "{{count}} characters maximum."
text_caracters_minimum: "Must be at least {{count}} characters long."
text_length_between: "Length between {{min}} and {{max}} characters."
diff -r 8a49eabbb30a -r 432bb11e0390 db/migrate/20101123161346_create_ssamr_user_details.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/db/migrate/20101123161346_create_ssamr_user_details.rb Thu Dec 16 10:03:20 2010 +0000
@@ -0,0 +1,14 @@
+class CreateSsamrUserDetails < ActiveRecord::Migration
+ def self.up
+ create_table :ssamr_user_details do |t|
+ t.integer :user_id
+ t.text :description
+ t.text :university
+ end
+ end
+
+ def self.down
+ drop_table :ssamr_user_details
+ end
+
+end
diff -r 8a49eabbb30a -r 432bb11e0390 test/fixtures/ssamr_user_details.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/ssamr_user_details.yml Thu Dec 16 10:03:20 2010 +0000
@@ -0,0 +1,7 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+# one:
+# column: value
+#
+# two:
+# column: value
diff -r 8a49eabbb30a -r 432bb11e0390 test/unit/ssamr_user_details_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/unit/ssamr_user_details_test.rb Thu Dec 16 10:03:20 2010 +0000
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class SsamrUserDetailsTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "User Id should be correct" do
+ assert_equal user_id, user.id
+ end
+end