Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Skip active record properly in 'plugin new' generator

  • Loading branch information...
commit b6497d3b5a84ca5e7e15700419ddf44c096c57a2 1 parent 57fae9b
@drogus authored
View
2  railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
@@ -6,7 +6,7 @@
Rails.backtrace_cleaner.remove_silencers!
-<% if full? -%>
+<% if full? && !options[:skip_active_record] -%>
# Run any available migration from application
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
# and from engine
View
1  railties/test/generators/plugin_new_generator_test.rb
@@ -59,6 +59,7 @@ def test_ensure_that_plugin_options_are_not_passed_to_app_generator
def test_ensure_that_skip_active_record_option_is_passed_to_app_generator
run_generator [destination_root, "--skip_active_record"]
assert_no_file "test/dummy/config/database.yml"
+ assert_no_match /ActiveRecord/, File.read(File.join(destination_root, "test/test_helper.rb"))
end
def test_ensure_that_database_option_is_passed_to_app_generator
Please sign in to comment.
Something went wrong with that request. Please try again.