解决冲突

exceptionHandle
fanqiang 12 years ago
parent fa38d479dc
commit bb5e066d50

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

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

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

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

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

@ -37,7 +37,7 @@ class News < ActiveRecord::Base
after_create :add_author_as_watcher
# fq
after_save :act_as_activity
after_create :act_as_activity
# end
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><table width="580px" border="0">
<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>
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td>
</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,
: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),

@ -6,7 +6,7 @@
height: 30px;
line-height: 18px;
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;
padding: 0px 0px 4px 0px;
border-radius: 2px;
@ -21,7 +21,7 @@
height: 30px;
line-height: 18px;
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;
padding: 0px 0px 4px 0px;
border-radius: 2px;

@ -7,7 +7,7 @@
height: 30px;
line-height: 18px;
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;
padding: 0px 0px 4px 0px;
border-radius: 2px;

@ -2,5 +2,5 @@
<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: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 %>

@ -6,7 +6,7 @@
height: 30px;
line-height: 18px;
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;
padding: 0px 0px 4px 0px;
border-radius: 2px;
@ -21,7 +21,7 @@
height: 30px;
line-height: 18px;
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;
padding: 0px 0px 4px 0px;
border-radius: 2px;

Loading…
Cancel
Save