mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:29:30 +08:00
Allow the content_sha1
column of topic_embed
to be nullable
This commit is contained in:
parent
d1e7fa1c47
commit
079123f008
|
@ -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(/\-+/, '-')
|
||||
|
|
5
db/migrate/20140402201432_make_content_sha1_nullable.rb
Normal file
5
db/migrate/20140402201432_make_content_sha1_nullable.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class MakeContentSha1Nullable < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :topic_embeds, :content_sha1, :string, :limit => 40, :null => true
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user