Extract ActionText::Record
Permit applications to hack in custom DB config for ActionText::RichText until AT has first-class multi-DB support: ActiveSupport.on_load(:action_text_record) do connects_to reading: :action_text_replica, writing: :action_text_primary end
This commit is contained in:
parent
a50d2f1993
commit
b0287d0681
9
actiontext/app/models/action_text/record.rb
Normal file
9
actiontext/app/models/action_text/record.rb
Normal file
@ -0,0 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ActionText
|
||||
class Record < ActiveRecord::Base #:nodoc:
|
||||
self.abstract_class = true
|
||||
end
|
||||
end
|
||||
|
||||
ActiveSupport.run_load_hooks :action_text_record, ActionText::Record
|
@ -5,7 +5,7 @@ module ActionText
|
||||
# It also holds all the references to the embedded files, which are stored using Active Storage.
|
||||
# This record is then associated with the Active Record model the application desires to have
|
||||
# rich text content using the +has_rich_text+ class method.
|
||||
class RichText < ActiveRecord::Base
|
||||
class RichText < Record
|
||||
self.table_name = "action_text_rich_texts"
|
||||
|
||||
serialize :body, ActionText::Content
|
||||
|
Loading…
Reference in New Issue
Block a user