mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Merge pull request #1088 from ComputerDruid/fix-ipv6
Fix ipv6 addresses in the database
This commit is contained in:
@ -26,7 +26,7 @@ describe TopicLinkClick do
|
||||
|
||||
context 'create' do
|
||||
before do
|
||||
TopicLinkClick.create(topic_link: @topic_link, ip: '192.168.1.1')
|
||||
TopicLinkClick.create(topic_link: @topic_link, ip_address: '192.168.1.1')
|
||||
end
|
||||
|
||||
it 'creates the forum topic link click' do
|
||||
@ -39,7 +39,7 @@ describe TopicLinkClick do
|
||||
end
|
||||
|
||||
it 'serializes and deserializes the IP' do
|
||||
TopicLinkClick.first.ip.to_s.should == '192.168.1.1'
|
||||
TopicLinkClick.first.ip_address.to_s.should == '192.168.1.1'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -236,7 +236,7 @@ describe TopicLink do
|
||||
it 'has the correct results' do
|
||||
TopicLink.extract_from(post)
|
||||
topic_link = post.topic.topic_links.first
|
||||
TopicLinkClick.create(topic_link: topic_link, ip: '192.168.1.1')
|
||||
TopicLinkClick.create(topic_link: topic_link, ip_address: '192.168.1.1')
|
||||
|
||||
counts_for[post.id].should be_present
|
||||
counts_for[post.id].find {|l| l[:url] == 'http://google.com'}[:clicks].should == 0
|
||||
|
@ -6,7 +6,7 @@ describe View do
|
||||
it { should belong_to :user }
|
||||
it { should validate_presence_of :parent_type }
|
||||
it { should validate_presence_of :parent_id }
|
||||
it { should validate_presence_of :ip }
|
||||
it { should validate_presence_of :ip_address }
|
||||
it { should validate_presence_of :viewed_at }
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user