Commit Graph

12 Commits

Author SHA1 Message Date
Brian Kelly e9cf3e4e1c Fixes Options documention formatting for has_rich_text 2022-01-22 13:57:47 -06:00
Alex Ghiculescu 7f348eb9d4 Document Active Storage & Action Text eager loading
Docs for https://github.com/rails/rails/pull/40842 + https://github.com/rails/rails/pull/39397

[ci skip]
2021-06-14 11:03:48 -05:00
Jorge Manrubia 588c972d21 Removes the Action Text dependency from Active Record
Move the Action Text stuff to its own concern in `actiontext`.
2021-04-01 15:02:15 +02:00
Jorge Manrubia f046617853 Temporary change just to confirm this is the problem with some intermittent failures in buildkite
[skip ci]
2021-04-01 15:02:14 +02:00
Jorge Manrubia 638a92f734 Initial extraction from active_record_encryption gem 2021-04-01 15:02:13 +02:00
Ryuta Kamizono 7b680baea2 Remove `require "active_support/core_ext/symbol/starts_ends_with"`
Ruby 2.7 has native `Symbol#start_with?` and `Symbol#end_with?`.
2021-02-09 22:31:09 +09:00
Ryuta Kamizono 64c254017e Add explicit require for `Symbol#start_with?` 2020-11-25 15:22:32 +09:00
matt swanson 9b6459aab6
Add support for eager loading all rich text associations at once (#39397)
* Add `with_all_rich_text` method to eager load all RichText models at once

* Update actiontext/test/test_helper.rb

Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>

* Update actiontext/lib/action_text/attribute.rb

Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>

Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>
2020-11-24 18:19:46 +01:00
Kyohei Toyoda 07533a3d2f Add method to confirm rich text content existence by adding ? after content name
This change introduces a rich text object to make
it easier to confirm it context is existing or not.

If we have a class like below.

class Information < ApplicationRecord
  has_rich_text :notes
end

Before:
i = Information.new
i.notes? => NoMethodError
i.notes = "Some sample text"
i.notes.present? => true

After:
i = Information.new
i.notes? => false

i.notes = "Some sample text"
i.notes? => true
2019-12-13 12:58:42 +09:00
George Claghorn ff7948b1c2 Avoid creating ActionText::RichText records unnecessarily
Assigning a has_one association for a persisted record saves the change immediately, so attempting to read a rich-text attribute on a persisted record without a corresponding ActionText::RichText would eagerly create one. Avoid assigning the rich text association to fix.
2019-03-23 10:04:48 -04:00
George Claghorn c399f7d07a
Fix updating rich text via nested attributes
Closes #35159.
2019-03-17 17:22:46 -04:00
George Claghorn 0decd2ddc4 Import Action Text 2019-01-04 22:22:49 -05:00