diff options
Diffstat (limited to 'lib/active_text')
-rw-r--r-- | lib/active_text/attachable.rb | 2 | ||||
-rw-r--r-- | lib/active_text/attachment.rb | 4 | ||||
-rw-r--r-- | lib/active_text/attribute.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/active_text/attachable.rb b/lib/active_text/attachable.rb index 3a6648331e..f3ea47282f 100644 --- a/lib/active_text/attachable.rb +++ b/lib/active_text/attachable.rb @@ -53,7 +53,7 @@ module ActiveText super.merge(attachable_sgid: attachable_sgid) end - def to_active_text_attributes(attributes = {}) + def to_rich_text_attributes(attributes = {}) attributes.dup.tap do |attributes| attributes[:sgid] = attachable_sgid attributes[:content_type] = attachable_content_type diff --git a/lib/active_text/attachment.rb b/lib/active_text/attachment.rb index 870390f63e..fab6c3507b 100644 --- a/lib/active_text/attachment.rb +++ b/lib/active_text/attachment.rb @@ -20,7 +20,7 @@ module ActiveText end def from_attachable(attachable, attributes = {}) - if node = node_from_attributes(attachable.to_active_text_attributes(attributes)) + if node = node_from_attributes(attachable.to_rich_text_attributes(attributes)) new(node, attachable) end end @@ -91,7 +91,7 @@ module ActiveText end def attachable_attributes - @attachable_attributes ||= (attachable.try(:to_active_text_attributes) || {}).stringify_keys + @attachable_attributes ||= (attachable.try(:to_rich_text_attributes) || {}).stringify_keys end def sgid_attributes diff --git a/lib/active_text/attribute.rb b/lib/active_text/attribute.rb index 9d872a87a1..9f3ee49998 100644 --- a/lib/active_text/attribute.rb +++ b/lib/active_text/attribute.rb @@ -3,7 +3,7 @@ module ActiveText extend ActiveSupport::Concern class_methods do - def active_text_attribute(attribute_name) + def has_rich_text(attribute_name) serialize(attribute_name, ActiveText::Content) has_many_attached "#{attribute_name}_attachments" |