diff --git a/app/models/project.rb b/app/models/project.rb index eec60cdde..c64dd5060 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -67,9 +67,6 @@ class Project < ActiveRecord::Base #ADDED BY NIE has_many :project_infos, :dependent => :destroy has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy - has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy - has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy - has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy has_many :user_grades, :class_name => "UserGrade", :dependent => :destroy #end diff --git a/app/models/user.rb b/app/models/user.rb index 4196b3030..40e142e92 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -152,6 +152,15 @@ class User < Principal } scope :sorted, lambda { order(*User.fields_for_order_statement)} + scope :like, lambda {|arg| + if arg.blank? + where(nil) + else + pattern = "%#{arg.to_s.strip.downcase}%" + where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) + end + } + ###添加留言 fq def add_jour(user, notes, reference_user_id = 0) diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index cc4672ea6..0a40e3d0e 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -5,9 +5,6 @@
<%= l(:label_task_plural)%> | - - -
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
diff --git a/app/views/bids/_new.html.erb b/app/views/bids/_new.html.erb
index 5250a361d..cf9f8df30 100644
--- a/app/views/bids/_new.html.erb
+++ b/app/views/bids/_new.html.erb
@@ -1,41 +1,4 @@
-
-
|