* Use rails_command instead of run (will also print "rails" in the output)
* Generally tune colors: print green for the status updates,
red for the warning to get the eye.
* Combine migration copying into running one task and pass FROM.
Generates "create_tables.engine_name.rb" migrations.
* Slim some variables and style the copy_file invocation.
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
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.
Fixes that file attachments without captions would not be represented in plain text generated from rich-text content, causing ActionText::RichText#present? to return false.
Closes#36607.
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.
The Action Text installations appends `require("trix")` to the application.js file. The problem is that there isn't a line break in the beginning of the installation output, leading to syntax errors, e.g.:
```
import './application.scss'require("trix")
```
This commit moves the line break from the end to the beginning of the output, fixing it to:
```
import './application.scss'
require("trix")
```