提交 20939b3f 编写于 作者: S Santiago Pastorino

config.generators.api_only = true set rails api option on generators

上级 e8100fc4
......@@ -105,6 +105,10 @@ def self.fallbacks
def self.api_only!
hide_namespaces "assets", "helper", "css", "js"
options[:rails].merge!(
api: true
)
end
# Remove the color from output.
......
......@@ -126,7 +126,7 @@ def with_bare_config
end
end
test "api only generators hide assets, helper, js and css namespaces" do
test "api only generators hide assets, helper, js and css namespaces and set api option" do
add_to_config <<-RUBY
config.generators.api_only = true
RUBY
......@@ -139,6 +139,7 @@ def with_bare_config
assert Rails::Generators.hidden_namespaces.include?("helper")
assert Rails::Generators.hidden_namespaces.include?("js")
assert Rails::Generators.hidden_namespaces.include?("css")
assert Rails::Generators.options[:rails][:api]
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册