Commit Graph

68 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
1f325fab01
Merge pull request #37053 from yahonda/ignore_sqlite3_parallel_testing_databases
Ignore SQLite3 database files generated by parallel testing
2019-08-27 09:15:58 -03:00
Yasuo Honda
c5e3c537a4 Ignore SQLite3 database files generated by parallel testing
Rails 6.0 introduces parallel testing and the default degree of parallelism is configured based on the number of CPU.
refer https://github.com/rails/rails/pull/34735 https://github.com/rails/rails/pull/31900

When any minitest executed under the OS where 2 or more CPU available,
SQLite 3 database files are not git-ignored.

Also updated other files which ignores SQLite database files.

* Steps to reproduce

```
$ git clone https://github.com/yahonda/rep_ignore_sqlite3_databases.git
$ cd rep_ignore_sqlite3_databases/
$ bin/rails test
$ git status
```

* Expected behavior:

- No `Untracked files:`

* Actual behavior:

- SQLite 3 database files appeared

```
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	db/test.sqlite3-0
	db/test.sqlite3-1
	db/test.sqlite3-2
	db/test.sqlite3-3
	db/test.sqlite3-4
	db/test.sqlite3-5

nothing added to commit but untracked files present (use "git add" to track)
$
```
2019-08-27 11:42:04 +00:00
Jan Habermann
40be6b1d4d Cleanup unneeded blank string params in ActionText 2019-08-23 20:17:38 +02:00
Javan Makhmali
55a5aac670 Optimize Action Text's plain text conversion
Fixes that converting deeply nested elements could exceed the stack level.
2019-08-22 16:24:51 -04:00
Juanito Fatas
52f0b050e2
Update sanitizer in ActionView::Helpers::SanitizeHelper
- The sanitizer has been changed to safe_list_sanitizer.
- deprecate white_list_sanitizer
2019-08-05 03:35:35 +02:00
Akira Matsuda
530f7805ed It may be better to explicitly require 'object/try' where we call try
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.
2019-08-01 18:51:51 +09:00
Javan Makhmali
aa00aec32a Bump Trix to ^1.2.0
Adds an attachment button to the Trix toolbar that improves overall file upload usability, especially on mobile devices where files can't be dragged / dropped.

References:
- https://github.com/basecamp/trix/releases/tag/1.2.0
- https://github.com/basecamp/trix/pull/619
- https://github.com/basecamp/trix/issues/582
2019-07-30 10:12:14 -04:00
Akira Matsuda
0196551e60 Use match? where we don't need MatchData 2019-07-29 14:23:10 +09:00
Akira Matsuda
0d981a2b3d Let the generated initializers/backtrace_silencers.rb code use Regexp#match? 2019-07-29 14:21:30 +09:00
George Claghorn
930402101c Implement ActiveStorage::Blob#attachable_plain_text_representation
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.
2019-07-07 22:03:06 -04:00
Ryuta Kamizono
cc27e9988f Unify to use 4 spaces indentation in CHANGELOGs [ci skip]
Especially, somehow `CHANGELOG.md` in actiontext and activestorage in
master branch had used 3 spaces indentation.
2019-06-05 05:53:49 +09:00
George Claghorn
973096b6ae Correct test name 2019-05-20 13:59:06 -04:00
George Claghorn
339be65d66 Allow filling in the only rich-text area without a locator 2019-05-19 01:55:53 -04:00
George Claghorn
a0b102999a Prefer Capybara::Node::Element#execute_script 2019-05-19 01:47:29 -04:00
George Claghorn
aa7da0471f Deduplicate ActionText::RichText embeds
Fix that an ActiveRecord::RecordNotUnique error would be raised when saving rich-text content with the same file attached multiple times.
2019-05-17 16:46:16 -04:00
George Claghorn
b2b6341374
Add ActionDispatch::SystemTestCase#fill_in_rich_text_area 2019-05-13 12:44:06 -04:00
George Claghorn
4222acf152 Update Webpacker in Action Text's test dummy app 2019-05-11 20:27:37 -04:00
Rafael Mendonça França
9834be6565
Start Rails 6.1 development 2019-04-24 15:57:14 -04:00
Javan Makhmali
0ec2a90754 Make Action Text's rendering helpers more configurable
- Allow configuring the sanitizer and its options
- Split attachment rendering and sanitizing helpers so each can be overridden by applications
2019-04-22 10:15:25 -04:00
Abhay Nikam
cfe30cee3e Adds a warning message for action text installer if application pack is missing. 2019-04-19 08:30:59 +05:30
Fumiaki MATSUSHIMA
61c4be4777 Output junit format test report 2019-04-04 14:34:46 +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
eileencodes
a2bd669ed2 v6.0.0.beta3 release
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEEvJkGf0BARV+D0L2ulxXUSC76N8FAlyJN4cACgkQulxXUSC7
 6N9ZXAf/Wx7edIct8kZzcC6irlROx4DzpNbrrH792sO1OAcnoFDE7DPkokllTEP/
 4kzC42lca/XG27MCl7E0dtVD8hIyAl89nxid6cwKFVZVTPIRVc1wjXkoiWy/cvd7
 6+9IjxhlgrzxGnw3aWZJG7H3iqz69yr55aoSDU/TbMqq5kQrqNF95vr2nc8LEUco
 SLQj0pO/tfJdHquSeX0JiXn3VSEHT+5TdLGQ3J/w0wFU6mkecH4MJMJvMwLFx/v4
 llnvF6HyfSLASWbrpdD3h6MQHpImDoee5vILXAHzPdSaEVcVa1cDFtMcPMYiu8Dw
 AGdCAaHQhZFFGoYK472+o6pur0dxEA==
 =5dET
 -----END PGP SIGNATURE-----

Merge tag 'v6.0.0.beta3'

v6.0.0.beta3 release
2019-03-13 13:11:10 -04:00
eileencodes
7c87fd5635 Prep release
* Update RAILS_VERSION
* Bundle
* rake update_versions
* rake changelog:header
2019-03-11 11:58:15 -04:00
Javan Makhmali
f1b8bb4e1f
Merge pull request #35485 from excid3/default-attachable-trix-partial
Adds default trix content attachmment partial path
2019-03-11 08:38:52 -07:00
Ryuta Kamizono
b7fa01bb2f
Merge pull request #35529 from abhaynikam/35492-follow-up-to-updates-links-to-https
Updated links from http to https in guides, docs, etc
2019-03-09 20:49:27 +09:00
Abhay Nikam
476abd403b Updated links from http to https in guides, docs, etc 2019-03-09 16:43:47 +05:30
Sharang Dashputre
bf87dae202 Upgrade webpack-dev-server version in test apps 2019-03-09 03:35:22 +05:30
Sharang Dashputre
8eaffa1945 Use the latest stable release of webpacker 2019-03-09 00:14:17 +05:30
Chris LaRose
c03a50ade3 Explicitly require rails-html-sanitizer gem in ActionText helpers
If the [`action_text.helper` initializer][0] runs after
`ActionController::Base` has been loaded, but before the
`rails-html-sanitizer` gem has been `require`d, then the reference to
the constant `Rails::Html` in the body of the
`ActionText::ContentHelper` module raises an `uninitialized constant`
exception.

[0]: 2170338239/actiontext/lib/action_text/engine.rb (L31-L35)
2019-03-06 17:32:03 -08:00
Chris Oliver
764803e07a Adds default trix partial 2019-03-05 11:29:32 -06:00
Rafael Mendonça França
5e6e505083
Preparing for 6.0.0.beta2 release 2019-02-25 17:45:04 -05:00
yuuji.yaginuma
90f853581a Disable available locale checks in Action Test test
Without this change, `store_translations` silently fails when available
locales already initialized.

Ref:
https://travis-ci.org/rails/rails/jobs/497615616#L6846
https://travis-ci.org/rails/rails/jobs/497605027#L6856
2019-02-24 14:01:52 +09:00
Abhay Nikam
b3778c5708 Allows rich_text_area_tag to add I18n translated placeholder text if placeholder option set to true 2019-02-22 10:18:21 +05:30
Ryuta Kamizono
da5843436b SQLite3: Implement add_foreign_key and remove_foreign_key
I implemented Foreign key create in `create_table` for SQLite3 at
#24743. This follows #24743 to implement `add_foreign_key` and
`remove_foreign_key`.
Unfortunately SQLite3 has one limitation that
`PRAGMA foreign_key_list(table-name)` doesn't have constraint name.
So we couldn't implement find/remove foreign key by name for now.

Fixes #35207.
Closes #31343.
2019-02-11 14:15:16 +09:00
Ryuta Kamizono
8309cd2c68
Merge pull request #35071 from kamipo/text_without_limit
MySQL: Support `:size` option to change text and blob size
2019-01-29 17:02:04 +09:00
Ryuta Kamizono
1745e905a3 Allow changing text and blob size without giving the limit option
In MySQL, the text column size is 65,535 bytes by default (1 GiB in
PostgreSQL). It is sometimes too short when people want to use a text
column, so they sometimes change the text size to mediumtext (16 MiB) or
longtext (4 GiB) by giving the `limit` option.

Unlike MySQL, PostgreSQL doesn't allow the `limit` option for a text
column (raises ERROR: type modifier is not allowed for type "text").
So `limit: 4294967295` (longtext) couldn't be used in Action Text.

I've allowed changing text and blob size without giving the `limit`
option, it prevents that migration failure on PostgreSQL.
2019-01-29 06:49:32 +09:00
Ryuta Kamizono
b8baa15adb Revert "Apply t.timestamps changes in Action Text and Action Mailbox"
This reverts commit 30f666f87ab873258b797b39f29cf852f7621bea.
2019-01-29 06:37:42 +09:00
Ryuta Kamizono
30f666f87a Apply t.timestamps changes in Action Text and Action Mailbox
Follow up #34956.
2019-01-29 04:59:36 +09:00
Vinicius Brasil
95e00befbc
Add line break to Action Text installation outputs
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")
```
2019-01-27 22:30:17 -02:00
Ryuta Kamizono
5a8f0c7226
Merge pull request #34970 from kamipo/timestamps_with_precision_by_default
Make `t.timestamps` with precision by default.
2019-01-26 23:37:17 +09:00
Ryuta Kamizono
57015cdfa2 Make t.timestamps with precision by default 2019-01-26 22:49:14 +09:00
Javan Makhmali
48c6ef9a72 Fix error saving Action Text content containing non-blob attachables
Failing test before the ActionText::RichText change:

```
Error:
ActionText::ModelTest#test_embed_extraction_only_extracts_file_attachments:
ArgumentError: Could not find or build blob: expected attachable, got #<ActionText::Attachables::RemoteImage:0x00007fb0259fef70 @url="http://example.com/cat.jpg", @content_type="image", @width=nil, @height=nil>
```
2019-01-25 16:57:36 -05:00
George Claghorn
c1e949e9e6 Prefer ImageProcessing's resize_to_limit macro over resize_to_fit
Don't upsize images smaller than the specified dimensions.
2019-01-24 11:46:42 -05:00
colorbox
91fc859016 Fix document formatting on Action Text docs [ci skip]
Use `+` instead of backquote.
2019-01-24 17:44:35 +09:00
alkesh26
97909ddcf2 Changed webserver to web server. 2019-01-22 21:11:03 +05:30
Rafael Mendonça França
5a0230c67f
Preparing for 6.0.0.beta1 release 2019-01-18 15:42:12 -05:00
Ryuta Kamizono
9e4283eb1d
Merge pull request #34956 from kamipo/actionmailbox_datetime_precision
Allow using Action Mailbox on MySQL 5.5
2019-01-18 09:56:57 +09:00
Kasper Timm Hansen
9aa0815192
Action Text: bundle package.json in built gem.
After 866da19fd9fc12d001ab99ac87890ea1cebb2cd9 we now use package.json
to install Action Text's JS dependencies (see JS_PACKAGE_PATH).

But when the gem pacakge for Action Text is built, package.json was not
included so running `rails action_text:install` in a Rails app would
fail with:

```
rails action_text:install
rails aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - xxx/gems/actiontext-6.0.0.alpha/lib/templates/../../package.json
./bin/rails:4:in `<main>'
Tasks: TOP => app:template
(See full trace by running task with --trace)
```
2019-01-18 00:11:18 +01:00