diff --git a/app/models/topic_embed.rb b/app/models/topic_embed.rb index 7321b32f0..8b7ffd09b 100644 --- a/app/models/topic_embed.rb +++ b/app/models/topic_embed.rb @@ -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(/\-+/, '-') diff --git a/db/migrate/20140402201432_make_content_sha1_nullable.rb b/db/migrate/20140402201432_make_content_sha1_nullable.rb new file mode 100644 index 000000000..29b7572ed --- /dev/null +++ b/db/migrate/20140402201432_make_content_sha1_nullable.rb @@ -0,0 +1,5 @@ +class MakeContentSha1Nullable < ActiveRecord::Migration + def change + change_column :topic_embeds, :content_sha1, :string, :limit => 40, :null => true + end +end diff --git a/spec/models/topic_embed_spec.rb b/spec/models/topic_embed_spec.rb index e75ea0a98..81b246373 100644 --- a/spec/models/topic_embed_spec.rb +++ b/spec/models/topic_embed_spec.rb @@ -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