diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb index 48574bca..0fdb1b2c 100644 --- a/app/controllers/praise_tread_controller.rb +++ b/app/controllers/praise_tread_controller.rb @@ -10,7 +10,6 @@ class PraiseTreadController < ApplicationController @obj_id = params[:obj_id] @obj_type = params[:obj_type] @obj = find_object_by_type_and_id(@obj_type,@obj_id) - # @is_in_list = params[:is_in_list] praise_tread_plus(@obj_type,@obj_id,1) end end @@ -46,7 +45,6 @@ class PraiseTreadController < ApplicationController @obj_id = params[:obj_id] @obj_type = params[:obj_type] @obj = find_object_by_type_and_id(@obj_type,@obj_id) - # @is_in_list = params[:is_in_list] praise_tread_plus(@obj_type,@obj_id,0) end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 20494dad..e33104f9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -31,7 +31,7 @@ class UsersController < ApplicationController accept_api_auth :index, :show, :create, :update, :destroy,:tag_save #william - before_filter :need_login,:only => :tag_save + before_filter :require_login,:only => :tag_save helper :sort diff --git a/app/helpers/praise_tread_helper.rb b/app/helpers/praise_tread_helper.rb index 26e4e5f4..90ce6d61 100644 --- a/app/helpers/praise_tread_helper.rb +++ b/app/helpers/praise_tread_helper.rb @@ -9,17 +9,18 @@ module PraiseTreadHelper end #end - def get_praise_num(object,flag) + def get_praise_num(object) @obj_type = object.class @obj_id = object.id @record = PraiseTreadCache.find_by_object_id_and_object_type(@obj_id,@obj_type) if @record - case flag - when 1 - return @record.praise_num.nil? ? 0 : @record.praise_num - when 0 - return @record.tread_num.nil? ? 0 : @record.tread_num - end + # case flag + # when 1 + # return @record.praise_num.nil? ? 0 : @record.praise_num + # when 0 + # return @record.tread_num.nil? ? 0 : @record.tread_num + # end + return (@record.praise_num.to_i-@record.tread_num.to_i) else return 0 end diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 2917bdf4..e03587c5 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -2,6 +2,8 @@