Fix #4038: Attempting to create an IP-ban bans the creator.
* Rename comments.ip_addr to comments.creator_ip_addr. * Fix belongs_to_creator to not clobber ip_addr field.
This commit is contained in:
@@ -178,7 +178,7 @@ class ApplicationRecord < ActiveRecord::Base
|
||||
protected
|
||||
|
||||
def hidden_attributes
|
||||
[:uploader_ip_addr, :updater_ip_addr, :creator_ip_addr, :ip_addr]
|
||||
[:uploader_ip_addr, :updater_ip_addr, :creator_ip_addr]
|
||||
end
|
||||
|
||||
def method_attributes
|
||||
@@ -243,7 +243,6 @@ class ApplicationRecord < ActiveRecord::Base
|
||||
if rec.creator_id.nil?
|
||||
rec.creator_id = CurrentUser.id
|
||||
rec.creator_ip_addr = CurrentUser.ip_addr if rec.respond_to?(:creator_ip_addr=)
|
||||
rec.ip_addr = CurrentUser.ip_addr if rec.respond_to?(:ip_addr=)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user