Allow the content_sha1 column of topic_embed to be nullable

This commit is contained in:
Robin Ward 2014-04-02 16:18:51 -04:00
parent d1e7fa1c47
commit 079123f008
3 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,6 @@ class TopicEmbed < ActiveRecord::Base
belongs_to :topic
belongs_to :post
validates_presence_of :embed_url
validates_presence_of :content_sha1
def self.normalize_url(url)
url.downcase.sub(/\/$/, '').sub(/\-+/, '-')

View File

@ -0,0 +1,5 @@
class MakeContentSha1Nullable < ActiveRecord::Migration
def change
change_column :topic_embeds, :content_sha1, :string, :limit => 40, :null => true
end
end

View File

@ -5,8 +5,6 @@ describe TopicEmbed do
it { should belong_to :topic }
it { should belong_to :post }
it { should validate_presence_of :embed_url }
it { should validate_presence_of :content_sha1 }
context '.import' do