Allow changing ownwership of posts by admins

This commit is contained in:
riking
2014-03-27 18:28:14 -07:00
parent 7a843d2ac2
commit 1540a3d5e5
22 changed files with 308 additions and 20 deletions

View File

@@ -41,6 +41,17 @@ class PostRevision < ActiveRecord::Base
}
end
def user_changes
prev = previous("user_id")
cur = current("user_id")
return if prev == cur
{
previous_user: User.where(id: prev).first,
current_user: User.where(id: cur).first
}
end
def previous(field)
lookup_with_fallback(field, 0)
end