expand external_feed_entries urls to text

fixes CNVS-23676
refs CNVS-17774

test plan
 - db:migrate should work

Change-Id: I13633c077e2f1c0b9b9df521dc8942c9c87d0aa3
Reviewed-on: https://gerrit.instructure.com/64091
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
This commit is contained in:
Rob Orton 2015-09-26 17:31:23 -06:00
parent 4ff8b7368e
commit 075c90cbad
2 changed files with 22 additions and 2 deletions

View File

@ -26,8 +26,13 @@ class ExternalFeedEntry < ActiveRecord::Base
before_save :infer_defaults
validates_presence_of :external_feed_id, :workflow_state
validates_length_of :title, :maximum => maximum_text_length, :allow_nil => true, :allow_blank => true
validates_length_of :message, :maximum => maximum_text_length, :allow_nil => true, :allow_blank => true
validates :title, length: {maximum: maximum_text_length, allow_nil: true, allow_blank: true}
validates :message, length: {maximum: maximum_text_length, allow_nil: true, allow_blank: true}
validates :source_url, length: {maximum: maximum_text_length, allow_nil: true, allow_blank: true}
validates :url, length: {maximum: maximum_text_length, allow_nil: true, allow_blank: true}
validates :author_name, length: {maximum: maximum_string_length, allow_nil: true, allow_blank: false}
validates :author_url, length: {maximum: maximum_text_length, allow_nil: true, allow_blank: false}
validates :author_email, length: {maximum: maximum_string_length, allow_nil: true, allow_blank: false}
sanitize_field :message, CanvasSanitize::SANITIZE
attr_accessible :title, :message, :source_name, :source_url, :posted_at, :start_at, :end_at, :user, :url, :uuid, :author_name, :author_url, :author_email, :asset

View File

@ -0,0 +1,15 @@
class ExpandExternalFeedUrlColumns < ActiveRecord::Migration
tag :postdeploy
def self.up
change_column :external_feed_entries, :url, :text
change_column :external_feed_entries, :source_url, :text
change_column :external_feed_entries, :author_url, :text
end
def self.down
change_column :external_feed_entries, :url, :string
change_column :external_feed_entries, :source_url, :string
change_column :external_feed_entries, :author_url, :string
end
end