From a888abbdf4200abc7929b5d903af50fc3c75b839 Mon Sep 17 00:00:00 2001 From: Jacob Fugal Date: Mon, 28 Oct 2013 14:58:47 -0600 Subject: [PATCH] don't include ActionController::UrlWriter w/rails3 refs CNVS-9166 include Rails.application.routes.url_helpers instead (in most of these, should be refactored to not include those either, but not going down that rabbit hole in this commit.) Change-Id: I3a7091ac604c811d9b7ad2777c289fc8c6477822 test-plan: N/A Reviewed-on: https://gerrit.instructure.com/25725 Reviewed-by: Jacob Fugal Tested-by: Jenkins Product-Review: Jacob Fugal QA-Review: Jacob Fugal --- app/models/calendar_event.rb | 6 +++++- app/models/conversation_message.rb | 6 +++++- app/models/discussion_topic/materialized_view.rb | 6 +++++- app/models/message.rb | 6 +++++- app/presenters/take_quiz_presenter.rb | 6 +++++- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/app/models/calendar_event.rb b/app/models/calendar_event.rb index 4275b6bbe7d..ec896d5bab8 100644 --- a/app/models/calendar_event.rb +++ b/app/models/calendar_event.rb @@ -606,7 +606,11 @@ class CalendarEvent < ActiveRecord::Base class IcalEvent include Api - include ActionController::UrlWriter + if CANVAS_RAILS2 + include ActionController::UrlWriter + else + include Rails.application.routes.url_helpers + end include TextHelper def initialize(event) diff --git a/app/models/conversation_message.rb b/app/models/conversation_message.rb index 733ca456841..8233443cdc2 100644 --- a/app/models/conversation_message.rb +++ b/app/models/conversation_message.rb @@ -17,7 +17,11 @@ # class ConversationMessage < ActiveRecord::Base - include ActionController::UrlWriter + if CANVAS_RAILS2 + include ActionController::UrlWriter + else + include Rails.application.routes.url_helpers + end include SendToStream include SimpleTags::ReaderInstanceMethods diff --git a/app/models/discussion_topic/materialized_view.rb b/app/models/discussion_topic/materialized_view.rb index 29880cb71fb..0322dd6d6fd 100644 --- a/app/models/discussion_topic/materialized_view.rb +++ b/app/models/discussion_topic/materialized_view.rb @@ -21,7 +21,11 @@ class DiscussionTopic::MaterializedView < ActiveRecord::Base include Api::V1::DiscussionTopics include Api - include ActionController::UrlWriter + if CANVAS_RAILS2 + include ActionController::UrlWriter + else + include Rails.application.routes.url_helpers + end attr_accessible :discussion_topic diff --git a/app/models/message.rb b/app/models/message.rb index 1edce598006..764f1b48d98 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -18,7 +18,11 @@ class Message < ActiveRecord::Base # Included modules - include ActionController::UrlWriter + if CANVAS_RAILS2 + include ActionController::UrlWriter + else + include Rails.application.routes.url_helpers + end include ERB::Util include SendToStream include TextHelper diff --git a/app/presenters/take_quiz_presenter.rb b/app/presenters/take_quiz_presenter.rb index 3bbc2e3d5bf..b9c6eeda207 100644 --- a/app/presenters/take_quiz_presenter.rb +++ b/app/presenters/take_quiz_presenter.rb @@ -1,5 +1,9 @@ class TakeQuizPresenter - include ActionController::UrlWriter + if CANVAS_RAILS2 + include ActionController::UrlWriter + else + include Rails.application.routes.url_helpers + end include ApplicationHelper attr_accessor :quiz,