actiontext 6.0.4.8 → 6.0.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actiontext might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/app/helpers/action_text/content_helper.rb +1 -0
- data/lib/action_text/attachments/trix_conversion.rb +1 -1
- data/lib/action_text/content.rb +2 -6
- data/lib/action_text/engine.rb +12 -9
- data/lib/action_text/gem_version.rb +2 -2
- data/lib/action_text/rendering.rb +29 -0
- data/lib/action_text.rb +1 -0
- data/package.json +1 -1
- metadata +16 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4475a564fddc94eab3c96d86f66a3190b5859647e0c8023857e743aaa684a117
|
4
|
+
data.tar.gz: bbd377f44089938f0112534f70a492ec5db8fe1c15ceee5caeb729198e34c5bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 859c99be184e2d2c9dd782ad388170045a6d1ee72b267fa5e5c2290c9f97781b059e1ad9d38ec50ed3d33f38307049fbdb740ada564f50329835b1bf7d444b7f
|
7
|
+
data.tar.gz: 9a51b912b87719543d378892b50548d265d5c96b2bed7d6d38e1e906d01947a3db90fea90382bdaea44a6d02b69085c0c5daaeef3a2d2f255553d79886736ad7
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## Rails 6.0.5 (May 09, 2022) ##
|
2
|
+
|
3
|
+
* Disentangle Action Text from ApplicationController
|
4
|
+
|
5
|
+
Allow Action Text to be used without having an ApplicationController
|
6
|
+
defined.
|
7
|
+
This makes sure:
|
8
|
+
* Action Text attachments render the correct URL host in mailers.
|
9
|
+
* an ActionController::Renderer isn't allocated per request.
|
10
|
+
* Sidekiq doesn't hang with the "classic" autoloader.
|
11
|
+
|
12
|
+
*Jonathan Hefner*
|
13
|
+
|
1
14
|
## Rails 6.0.4.8 (April 26, 2022) ##
|
2
15
|
|
3
16
|
* No changes.
|
@@ -26,7 +26,7 @@ module ActionText
|
|
26
26
|
private
|
27
27
|
def trix_attachment_content
|
28
28
|
if partial_path = attachable.try(:to_trix_content_attachment_partial_path)
|
29
|
-
ActionText::Content.
|
29
|
+
ActionText::Content.render(partial: partial_path, object: self, as: model_name.element)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
data/lib/action_text/content.rb
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "active_support/core_ext/module/attribute_accessors_per_thread"
|
4
|
-
|
5
3
|
module ActionText
|
6
4
|
class Content
|
7
|
-
include Serialization
|
8
|
-
|
9
|
-
thread_cattr_accessor :renderer
|
5
|
+
include Rendering, Serialization
|
10
6
|
|
11
7
|
attr_reader :fragment
|
12
8
|
|
@@ -88,7 +84,7 @@ module ActionText
|
|
88
84
|
end
|
89
85
|
|
90
86
|
def to_rendered_html_with_layout
|
91
|
-
|
87
|
+
render partial: "action_text/content/layout", locals: { content: self }
|
92
88
|
end
|
93
89
|
|
94
90
|
def to_s
|
data/lib/action_text/engine.rb
CHANGED
@@ -37,21 +37,24 @@ module ActionText
|
|
37
37
|
end
|
38
38
|
|
39
39
|
initializer "action_text.helper" do
|
40
|
-
|
41
|
-
|
40
|
+
%i[action_controller_base action_mailer].each do |abstract_controller|
|
41
|
+
ActiveSupport.on_load(abstract_controller) do
|
42
|
+
helper ActionText::Engine.helpers
|
43
|
+
end
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
45
|
-
initializer "action_text.renderer" do
|
46
|
-
app.executor.to_run { ActionText::Content.renderer = ApplicationController.renderer }
|
47
|
-
app.executor.to_complete { ActionText::Content.renderer = ApplicationController.renderer }
|
48
|
-
|
47
|
+
initializer "action_text.renderer" do
|
49
48
|
ActiveSupport.on_load(:action_text_content) do
|
50
|
-
self.renderer =
|
49
|
+
self.renderer = Class.new(ActionController::Base).renderer
|
51
50
|
end
|
52
51
|
|
53
|
-
|
54
|
-
|
52
|
+
%i[action_controller_base action_mailer].each do |abstract_controller|
|
53
|
+
ActiveSupport.on_load(abstract_controller) do
|
54
|
+
around_action do |controller, action|
|
55
|
+
ActionText::Content.with_renderer(controller, &action)
|
56
|
+
end
|
57
|
+
end
|
55
58
|
end
|
56
59
|
end
|
57
60
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/concern"
|
4
|
+
require "active_support/core_ext/module/attribute_accessors_per_thread"
|
5
|
+
|
6
|
+
module ActionText
|
7
|
+
module Rendering #:nodoc:
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
|
10
|
+
included do
|
11
|
+
thread_cattr_accessor :renderer, instance_accessor: false
|
12
|
+
delegate :render, to: :class
|
13
|
+
end
|
14
|
+
|
15
|
+
class_methods do
|
16
|
+
def with_renderer(renderer)
|
17
|
+
previous_renderer = self.renderer
|
18
|
+
self.renderer = renderer
|
19
|
+
yield
|
20
|
+
ensure
|
21
|
+
self.renderer = previous_renderer
|
22
|
+
end
|
23
|
+
|
24
|
+
def render(*args, &block)
|
25
|
+
renderer.render_to_string(*args, &block)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/action_text.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actiontext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javan Makhmali
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-05-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -18,56 +18,56 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 6.0.
|
21
|
+
version: 6.0.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 6.0.
|
28
|
+
version: 6.0.5
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: activerecord
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 6.0.
|
35
|
+
version: 6.0.5
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 6.0.
|
42
|
+
version: 6.0.5
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: activestorage
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 6.0.
|
49
|
+
version: 6.0.5
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 6.0.
|
56
|
+
version: 6.0.5
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: actionpack
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 6.0.
|
63
|
+
version: 6.0.5
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - '='
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 6.0.
|
70
|
+
version: 6.0.5
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: nokogiri
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/action_text/gem_version.rb
|
123
123
|
- lib/action_text/html_conversion.rb
|
124
124
|
- lib/action_text/plain_text_conversion.rb
|
125
|
+
- lib/action_text/rendering.rb
|
125
126
|
- lib/action_text/serialization.rb
|
126
127
|
- lib/action_text/trix_attachment.rb
|
127
128
|
- lib/action_text/version.rb
|
@@ -135,10 +136,11 @@ licenses:
|
|
135
136
|
- MIT
|
136
137
|
metadata:
|
137
138
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
138
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.0.
|
139
|
-
documentation_uri: https://api.rubyonrails.org/v6.0.
|
139
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.5/actiontext/CHANGELOG.md
|
140
|
+
documentation_uri: https://api.rubyonrails.org/v6.0.5/
|
140
141
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
141
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.0.
|
142
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.5/actiontext
|
143
|
+
rubygems_mfa_required: 'true'
|
142
144
|
post_install_message:
|
143
145
|
rdoc_options: []
|
144
146
|
require_paths:
|
@@ -154,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
156
|
- !ruby/object:Gem::Version
|
155
157
|
version: '0'
|
156
158
|
requirements: []
|
157
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.3.7
|
158
160
|
signing_key:
|
159
161
|
specification_version: 4
|
160
162
|
summary: Rich text framework.
|