Fix #3965: Extraneous API attributes.

Remove the updater_id/updater_ip_addr virtual attributes from
pools/notes. Juss pass them in as params to create_version instead.
This commit is contained in:
evazion
2018-10-30 14:32:55 -05:00
parent 39374a70d3
commit f5012464ab
8 changed files with 25 additions and 26 deletions

View File

@@ -85,6 +85,8 @@ class NoteTest < ActiveSupport::TestCase
assert_equal(@note.body, @note.versions.first.body)
assert_equal(1, @note.version)
assert_equal(1, @note.versions.first.version)
assert_equal(@user.id, @note.versions.first.updater_id)
assert_equal(CurrentUser.ip_addr, @note.versions.first.updater_ip_addr.to_s)
end
should "update the post's last_noted_at field" do
@@ -141,6 +143,8 @@ class NoteTest < ActiveSupport::TestCase
assert_equal(2, @note.versions.last.version)
assert_equal("fafafa", @note.versions.last.body)
assert_equal(2, @note.version)
assert_equal(@user.id, @note.versions.last.updater_id)
assert_equal(CurrentUser.ip_addr, @note.versions.last.updater_ip_addr.to_s)
end
context "for a note-locked post" do