解决冲突

exceptionHandle
fanqiang 12 years ago
parent fa38d479dc
commit bb5e066d50

@ -1,87 +1,94 @@
# class TestController < ApplicationController class TestController < ApplicationController
#
# before_filter :find_user, :only => [:new, :create, :destroy] before_filter :find_user, :only => [:new, :create, :destroy]
#
#
# def index def index
# #@watchers_of_projects = WatchersOfProjects.new
# #@watchers_of_projects.user_id = 1 # @message = Message.all
# #@watchers_of_projects.project_id = 1 # @message.each do |m|
# #@watchers_of_projects.save # Activity.create(:act_id => m.id, :act_type => 'Message', :user_id => m.author_id)
# # end
# #测试user表与watch_project表之间的关联是否成功
# #@user = User.find(params[:id])
# #@watch_table = @user.watch_projects.to_a.first #@watchers_of_projects = WatchersOfProjects.new
# #@watchers_of_projects.user_id = 1
# #@watch = WatchProject.find(1) #@watchers_of_projects.project_id = 1
# #@watcher = @watch.user #@watchers_of_projects.save
#
# #测试通过watch_project表使user表可以访问project表 #测试user表与watch_project表之间的关联是否成功
# #@watch_project = @user.projects #@user = User.find(params[:id])
# #watch_project_path(@watch) #@watch_table = @user.watch_projects.to_a.first
#
# #@project = Project.find(11) #@watch = WatchProject.find(1)
# #project_path(@project) #@watcher = @watch.user
# #@member = @project.users
# #@watched = @project.watch_projects #测试通过watch_project表使user表可以访问project表
# #@issue = Issue.find(6) #@watch_project = @user.projects
# #watch_project_path(@watch)
#
# #user_path(@user) #@project = Project.find(11)
# #issue_path(@issue) #project_path(@project)
# #@member = @project.users
# #@watcher2=WatchProject.where("#{WatchProject.table_name}.project_id = ?" , temp) #@watched = @project.watch_projects
# #@issue = Issue.find(6)
# #测试where语句
# #temp = 1
# #@watcher2=WatchProject.where(:project_id => temp).to_a #user_path(@user)
# #issue_path(@issue)
# #测试新建记录
# #@watch_new = WatchProject.new #@watcher2=WatchProject.where("#{WatchProject.table_name}.project_id = ?" , temp)
# #@watch_new.user_id = 4
# #@watch_new.project_id = 1 #测试where语句
# #@watch_new.save #temp = 1
# #@id = params[:id] #@watcher2=WatchProject.where(:project_id => temp).to_a
#
# #测试添加关注项目功能 #测试新建记录
# #WatchersOfProjects.watch(3,10) #@watch_new = WatchProject.new
# #Project.find(50) #@watch_new.user_id = 4
# #测试统计关注该项目的用户数 #@watch_new.project_id = 1
# #@count = WatchersOfProjects.watcher_count(@watch_project.to_a.first) #@watch_new.save
# #测试取消关注功能 #@id = params[:id]
# #WatchersOfProjects.watch_cancle(10,35)
# #测试添加关注项目功能
# #测试关注用户功能 #WatchersOfProjects.watch(3,10)
# #测试关注功能 #Project.find(50)
# #WatchersOfUser.watch_user(7,7) #测试统计关注该项目的用户数
# #测试取消关注功能 #@count = WatchersOfProjects.watcher_count(@watch_project.to_a.first)
# #WatchersOfUser.cancel_watching_user(1,2) #测试取消关注功能
# #测试查找关注的人功能 #WatchersOfProjects.watch_cancle(10,35)
# #@user = WatchersOfUser.find_users(1)
# #测试查找被关注的人功能 #测试关注用户功能
# #@user = WatchersOfUser.find_watchers(10) #测试关注功能
# #WatchersOfUser.watch_user(7,7)
# #测试用户留言功能 #测试取消关注功能
# #测试留言功能 #WatchersOfUser.cancel_watching_user(1,2)
#测试查找关注的人功能
#@user = WatchersOfUser.find_users(1)
#测试查找被关注的人功能
#@user = WatchersOfUser.find_watchers(10)
#测试用户留言功能
#测试留言功能
# MessagesForUser.leave_message(User.current.id, 6, 'test') # MessagesForUser.leave_message(User.current.id, 6, 'test')
# #测试查找留言功能 #测试查找留言功能
# #@message_table = MessagesForUser.find_message(3) #@message_table = MessagesForUser.find_message(3)
# #测试查找留言用户功能 #测试查找留言用户功能
# #@messager=@message_table.first.find_messager #@messager=@message_table.first.find_messager
#
#
# #测试需求 #测试需求
# #测试新建需求 #测试新建需求
# #bids = Bid.creat_bids(10000, '2013.7.25', 'test', 'sfsadgfag') #bids = Bid.creat_bids(10000, '2013.7.25', 'test', 'sfsadgfag')
# #测试修改需求 #测试修改需求
# #bids.update_bids(10, '2014.7.222', 'asdf') #bids.update_bids(10, '2014.7.222', 'asdf')
# #测试删除需求 #测试删除需求
# # bids = Bid.where('id = ?', 5) # bids = Bid.where('id = ?', 5)
# # bids.each do |bid| # bids.each do |bid|
# # bid.delete_bids # bid.delete_bids
# # end
# end # end
# end
# ##########留言功能 message by fq # ##########留言功能 message by fq
# def new # def new
# end # end
@ -112,7 +119,7 @@
# #format.api { render_api_ok } # #format.api { render_api_ok }
# end # end
# end # end
#
# private # private
# #
# def find_user # def find_user
@ -122,5 +129,5 @@
# rescue # rescue
# render_404 # render_404
# end # end
# #######end of message #######end of message
# end end

@ -18,7 +18,7 @@ class Bid < ActiveRecord::Base
# validates_format_of :deadline, :with => # validates_format_of :deadline, :with =>
validate :validate_user validate :validate_user
after_save :act_as_activity after_create :act_as_activity
scope :visible, lambda {|*args| scope :visible, lambda {|*args|
nil nil
@ -51,6 +51,7 @@ class Bid < ActiveRecord::Base
def self.creat_bids(budget, deadline, name, description=nil) def self.creat_bids(budget, deadline, name, description=nil)
self.create(:author_id => User.current.id, :budget => budget, self.create(:author_id => User.current.id, :budget => budget,
:deadline => deadline, :name => name, :description => description, :commit => 0) :deadline => deadline, :name => name, :description => description, :commit => 0)
# self.acts << Activity.new(:user_id => self.author_id)
end end
def update_bids(budget, deadline, name, description=nil) def update_bids(budget, deadline, name, description=nil)

@ -59,7 +59,7 @@ class Changeset < ActiveRecord::Base
before_create :before_create_cs before_create :before_create_cs
# fq # fq
after_save :act_as_activity after_create :act_as_activity
# end # end
def revision=(r) def revision=(r)

@ -45,7 +45,7 @@ class Journal < ActiveRecord::Base
before_create :split_private_notes before_create :split_private_notes
# fq # fq
after_save :act_as_activity after_create :act_as_activity
# end # end
scope :visible, lambda {|*args| scope :visible, lambda {|*args|

@ -51,7 +51,7 @@ class Message < ActiveRecord::Base
after_destroy :reset_counters! after_destroy :reset_counters!
# fq # fq
after_save :act_as_activity after_create :act_as_activity
# end # end
scope :visible, lambda {|*args| scope :visible, lambda {|*args|

@ -37,7 +37,7 @@ class News < ActiveRecord::Base
after_create :add_author_as_watcher after_create :add_author_as_watcher
# fq # fq
after_save :act_as_activity after_create :act_as_activity
# end # end
scope :visible, lambda {|*args| scope :visible, lambda {|*args|

@ -40,13 +40,13 @@
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td> <td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(journal.user), :class => "avatar"), user_path(journal.user), :class => "avatar" %></td>
<td><table width="580px" border="0"> <td><table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <a class="font_lighter"><%= l(:label_respond_requirement) %></a><%= link_to "##{journal.indice}", {}, :class => "journal-link" %> </td> <td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= l(:label_respond_requirement) %></span><%= link_to "##{journal.indice}", respond_path(bid), :class => "journal-link" %> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td> <td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td>
</tr> </tr>
<tr> <tr>
<td align="left"><a class="font_lighter"> <%= journal.created_on %></a></td> <td align="left"><span class="font_lighter"> <%= journal.created_on %></span></td>
<td width="200" align="right" class="a"><%= link_to(image_tag('comment.png'), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true, <td width="200" align="right" class="a"><%= link_to(image_tag('comment.png'), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%> :method => 'post', :title => l(:button_quote))%>
<%= link_to(image_tag('delete.png'), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm), <%= link_to(image_tag('delete.png'), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),

@ -6,7 +6,7 @@
height: 30px; height: 30px;
line-height: 18px; line-height: 18px;
font-size: 14px; font-size: 14px;
color: rgb(119, 119, 119); color: rgb(0, 0, 0);
background: url("../images/button/bg103.jpg") no-repeat scroll left top transparent; background: url("../images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;
@ -21,7 +21,7 @@
height: 30px; height: 30px;
line-height: 18px; line-height: 18px;
font-size: 14px; font-size: 14px;
color: rgb(119, 119, 119); color: rgb(0, 0, 0);
background: url("../images/button/bg103.jpg") no-repeat scroll left top transparent; background: url("../images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;

@ -7,7 +7,7 @@
height: 30px; height: 30px;
line-height: 18px; line-height: 18px;
font-size: 14px; font-size: 14px;
color: rgb(119, 119, 119); color: rgb(0, 0, 0);
background: url("../images/button/bg106.jpg") no-repeat scroll left top transparent; background: url("../images/button/bg106.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;

@ -2,5 +2,5 @@
<p><%= pref_fields.check_box :hide_mail %></p> <p><%= pref_fields.check_box :hide_mail %></p>
<p style="width:520px;"><%= pref_fields.time_zone_select :time_zone, nil, :include_blank => true %></p> <p style="width:520px;"><%= pref_fields.time_zone_select :time_zone, nil, :include_blank => true %></p>
<p style="width:477px;"><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p> <p style="width:477px;"><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p>
<p><%= pref_fields.check_box :warn_on_leaving_unsaved %></p>
<% end %> <% end %>

@ -6,7 +6,7 @@
height: 30px; height: 30px;
line-height: 18px; line-height: 18px;
font-size: 14px; font-size: 14px;
color: rgb(119, 119, 119); color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent; background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;
@ -21,7 +21,7 @@
height: 30px; height: 30px;
line-height: 18px; line-height: 18px;
font-size: 14px; font-size: 14px;
color: rgb(119, 119, 119); color: rgb(0, 0, 0);
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent; background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px; padding: 0px 0px 4px 0px;
border-radius: 2px; border-radius: 2px;

Loading…
Cancel
Save