Skip CSS when creating APIs.

Update CHANGELOG.

Address requested changes.
This commit is contained in:
Ruy R. 2024-01-28 20:38:04 -03:00
parent cf26c54829
commit 4ddf6ccad0
No known key found for this signature in database
GPG Key ID: 0B56AC3905A2BDEB
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,7 @@
* Skip CSS when generating APIs.
*Ruy Rocha*
* Rails console now indicates application name and the current Rails environment:
```txt

View File

@ -599,6 +599,7 @@ module Rails
end
def css_gemfile_entry
return if options[:api]
return unless options[:css]
if !using_js_runtime? && options[:css] == "tailwind"

View File

@ -94,6 +94,18 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase
assert_no_directory "app/views"
end
def test_generator_skip_css
run_generator [destination_root, "--api", "--css=tailwind"]
assert_file "Gemfile" do |content|
assert_no_match(%r/gem "tailwindcss-rails"/, content)
end
assert_no_file "app/views/layouts/application.html.erb" do |content|
assert_no_match(/tailwind/, content)
end
end
def test_app_update_does_not_generate_unnecessary_config_files
run_generator