Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
a64671f9de
|
@ -1,7 +1,12 @@
|
||||||
|
#coding=utf-8
|
||||||
class WatchesService
|
class WatchesService
|
||||||
def watch params
|
def watch params
|
||||||
@current_user = User.find(params[:current_user_id])
|
@current_user = User.find(params[:current_user_id])
|
||||||
|
if params[:object_type] == 'user' && params[:current_user_id] == params[:object_id]
|
||||||
|
raise '不能关注自己!'
|
||||||
|
end
|
||||||
@watchables = find_watchables params
|
@watchables = find_watchables params
|
||||||
|
|
||||||
if @watchables.nil?
|
if @watchables.nil?
|
||||||
raise '404'
|
raise '404'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue