Merge pull request #1088 from ComputerDruid/fix-ipv6

Fix ipv6 addresses in the database
This commit is contained in:
Sam
2013-06-25 17:25:48 -07:00
10 changed files with 53 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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 }