From 530f7805ed5790af1d472a041bc74089dc183f47 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 1 Aug 2019 18:43:25 +0900 Subject: It may be better to explicitly require 'object/try' where we call `try` In most cases it works now without explicit require because it's accidentally required through active_support/core_ext/date_and_time/calculations.rb where we still call `try`, but that would stop working if we changed the Calculations implementation and remove the require call there. --- actiontext/lib/action_text/attachment.rb | 2 ++ actiontext/lib/action_text/attachments/trix_conversion.rb | 2 ++ 2 files changed, 4 insertions(+) (limited to 'actiontext/lib') diff --git a/actiontext/lib/action_text/attachment.rb b/actiontext/lib/action_text/attachment.rb index e90a3e7d48..4bd537c7c2 100644 --- a/actiontext/lib/action_text/attachment.rb +++ b/actiontext/lib/action_text/attachment.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "active_support/core_ext/object/try" + module ActionText class Attachment include Attachments::TrixConversion, Attachments::Minification, Attachments::Caching diff --git a/actiontext/lib/action_text/attachments/trix_conversion.rb b/actiontext/lib/action_text/attachments/trix_conversion.rb index 24937d6c22..15319f4e37 100644 --- a/actiontext/lib/action_text/attachments/trix_conversion.rb +++ b/actiontext/lib/action_text/attachments/trix_conversion.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "active_support/core_ext/object/try" + module ActionText module Attachments module TrixConversion -- cgit v1.2.3