-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide initialization of Active Storage #30101
Provide initialization of Active Storage #30101
Conversation
r? @kaspth (@rails-bot has picked a reviewer for you, use r? to override) |
f71e14d
to
989d72e
Compare
rails new
c5d740f
to
780f237
Compare
168fe2f
to
8aae5f1
Compare
After adding Active Storage by default, new apps take up more space. This commit fixes it 02b64f4, but now there is another problem, it takes up more time for execution(https://travis-ci.org/rails/rails/builds/261934074). |
02b64f4
to
b49509d
Compare
end | ||
|
||
def comment_if(value) # :doc: | ||
options[value] ? "# " : "" | ||
comment = | ||
if value.is_a?(String) || value.is_a?(Symbol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of type check better to check if the class respond to the value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Agree. Thanks.
require "action_controller/railtie" | ||
require "action_view/railtie" | ||
<%= comment_if :skip_action_mailer %>require "action_mailer/railtie" | ||
require "active_job/railtie" | ||
require "active_storage/engine" | ||
<%= comment_if :skip_action_cable %>require "action_cable/engine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this was removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I missed.
4d9b6c5
to
2130d10
Compare
d11b2b8
to
317a9ba
Compare
Looking good so far. Could you rebase and fix the tests? |
:skip_sprockets, | ||
:skip_action_cable | ||
), | ||
skip_active_storage? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that specifying skip_active_storage
directly is more simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it is simpler, but I think it is more correctly use skip_active_storage?
We also need
|
@@ -153,6 +153,7 @@ def build_app(options = {}) | |||
|
|||
def teardown_app | |||
ENV["RAILS_ENV"] = @prev_rails_env if @prev_rails_env | |||
FileUtils.rm_rf(tmp_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentionally, see description of commit Fix error Errno::ENOSPC: No space left on device - sendfile
2e75442
to
8406d91
Compare
The tests are green! Thanks @y-yagi |
69dccd2
to
b203d31
Compare
Could you squash the commits? |
b203d31
to
ad81fee
Compare
@rafaelfranca done |
That are still too many commits related to the same change that can be squashed. |
…record is used Closes rails#30102 Revert part 787fe90 --skip-active-storage pass throughs `rails plugin new` Add changelog entry about default initialization of Active Storage
ad81fee
to
edf0c95
Compare
I squashed one more time. |
Omit `rails activestorage:install` for jdbcmysql, jdbc and shebang tests AppGeneratorTest#test_config_jdbcmysql_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/mysql_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_config_jdbc_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/jdbc_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_shebang_is_added_to_rails_file /home/ubuntu/.rbenv/versions/2.4.1/bin/ruby: no Ruby script found in input (LoadError) Prevent PendingMigrationError in tests * Run `bin/rails db:migrate RAILS_ENV=test` in test_cases before start tests to prevent PendingMigrationError * FileUtils.rm_r("db/migrate") * --skip-active-storage Fix failed tests in `railties/test/railties/engine_test.rb` Related to rails#30111 Imporve `SharedGeneratorTests#test_default_frameworks_are_required_when_others_are_removed` - Explicitly skip active_storage - Ensure that skipped frameworks are commented - Ensure that default frameworks are not commented Fix error `Errno::ENOSPC: No space left on device - sendfile` Since `rails new` runs `rails active_storage:install` that boots an app. Since adding Bootsnap 0312a5c during booting an app, it creates the cache: 264K tmp/cache/bootsnap-load-path-cache 27M tmp/cache/bootsnap-compile-cache * teardown_app must remove app
edf0c95
to
cb8553c
Compare
These were added in rails#30101, after rails#31084 it became redundant.
#30098 (comment)
Closes #30102