This commit is contained in:
sw 2014-12-11 15:38:30 +08:00
commit e618ce05a3
2 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,8 @@ class CourseGroup < ActiveRecord::Base
before_destroy :set_member_nil
attr_accessible :name
validates :name, :presence => true, :length => {:maximum => 20}, :uniqueness => true
validates :name, :presence => true, :length => {:maximum => 20},
:uniqueness => {case_sensitive: false}
def set_member_nil
if self.members && self.members.count > 0
self.members.update_all("course_group_id = 0")

View File

@ -2,8 +2,8 @@
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
<% if !@canShowCode %>
<%= join_in_course_group(@course.course_groups,@group, User.current) %>
<% end %>&nbsp;&nbsp;&nbsp;
<span style="font-size: 18px; float: left; margin-right: 35px">
<% end %>
<span style="font-size: 12px; float: left; margin-right: 5px">
<%= l(:label_current_group)%>:&nbsp;
<%= @group.name %>
</span>