fixes #1955
This commit is contained in:
@@ -171,13 +171,17 @@ class PostVersion < ActiveRecord::Base
|
|||||||
post.save!
|
post.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def updater_name
|
||||||
|
User.id_to_name(updater_id)
|
||||||
|
end
|
||||||
|
|
||||||
def serializable_hash(options = {})
|
def serializable_hash(options = {})
|
||||||
options ||= {}
|
options ||= {}
|
||||||
options[:except] ||= []
|
options[:except] ||= []
|
||||||
options[:except] += hidden_attributes
|
options[:except] += hidden_attributes
|
||||||
unless options[:builder]
|
unless options[:builder]
|
||||||
options[:methods] ||= []
|
options[:methods] ||= []
|
||||||
options[:methods] += [:added_tags, :removed_tags, :obsolete_added_tags, :obsolete_removed_tags, :unchanged_tags]
|
options[:methods] += [:added_tags, :removed_tags, :obsolete_added_tags, :obsolete_removed_tags, :unchanged_tags, :updater_name]
|
||||||
end
|
end
|
||||||
hash = super(options)
|
hash = super(options)
|
||||||
hash
|
hash
|
||||||
@@ -186,7 +190,7 @@ class PostVersion < ActiveRecord::Base
|
|||||||
def to_xml(options = {}, &block)
|
def to_xml(options = {}, &block)
|
||||||
options ||= {}
|
options ||= {}
|
||||||
options[:methods] ||= []
|
options[:methods] ||= []
|
||||||
options[:methods] += [:added_tags, :removed_tags, :obsolete_added_tags, :obsolete_removed_tags, :unchanged_tags]
|
options[:methods] += [:added_tags, :removed_tags, :obsolete_added_tags, :obsolete_removed_tags, :unchanged_tags, :updater_name]
|
||||||
super(options, &block)
|
super(options, &block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user