Include updater_name in /comments/1.json.
This commit is contained in:
@@ -48,9 +48,7 @@ class CommentsController < ApplicationController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@comment = Comment.find(params[:id])
|
@comment = Comment.find(params[:id])
|
||||||
respond_with(@comment) do |format|
|
respond_with(@comment)
|
||||||
format.json {render :json => @comment.to_json(:methods => [:creator_name])}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|||||||
@@ -199,6 +199,10 @@ class Comment < ActiveRecord::Base
|
|||||||
super + [:body_index]
|
super + [:body_index]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def method_attributes
|
||||||
|
super + [:creator_name, :updater_name]
|
||||||
|
end
|
||||||
|
|
||||||
def delete!
|
def delete!
|
||||||
update_attributes(:is_deleted => true)
|
update_attributes(:is_deleted => true)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user