diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-12-22 18:39:08 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-12-22 18:39:08 +0900 |
commit | 9917c0c255e1c1005b85885a15cc9a28bb8e4275 (patch) | |
tree | 94d60bbd6fad6a6f724394143d706f0da2198ead /railties/lib/rails | |
parent | aa96537d378e5f816478143a3cbc36fd28997074 (diff) | |
download | rails-9917c0c255e1c1005b85885a15cc9a28bb8e4275.tar.gz rails-9917c0c255e1c1005b85885a15cc9a28bb8e4275.tar.bz2 rails-9917c0c255e1c1005b85885a15cc9a28bb8e4275.zip |
remove cors initializer from rails app
`rack-cors` gem is defined in Gemfile by default only if the api,
not defined by default in rails app.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 16efa96207..f4deec7135 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -329,6 +329,12 @@ module Rails end end + def delete_api_initializers + unless options[:api] + remove_file 'config/initializers/cors.rb' + end + end + def finish_template build(:leftovers) end |