Skip to content

Commit

Permalink
Merge pull request #10448 from arunagw/bug-fix-scaffold-generator-master
Browse files Browse the repository at this point in the history
Fixes Scaffold generator with --assets=false
Conflicts:
	railties/CHANGELOG.md

Conflicts:
	railties/CHANGELOG.md
	railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb
  • Loading branch information
rafaelfranca committed May 4, 2013
1 parent 9d7a748 commit 927a04d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion railties/CHANGELOG.md
@@ -1,6 +1,9 @@
## unreleased ##

* No changes.
* Fixes bug with scaffold generator with `--assets=false --resource-route=false`.
Fixes #9525.

*Arun Agrawal*


## Rails 3.2.13 (Mar 18, 2013) ##
Expand Down
Expand Up @@ -8,6 +8,8 @@ class ScaffoldGenerator < ResourceGenerator #metagenerator

class_option :stylesheets, :type => :boolean, :desc => "Generate Stylesheets"
class_option :stylesheet_engine, :desc => "Engine for Stylesheets"
class_option :assets, :type => :boolean
class_option :resource_route, :type => :boolean

hook_for :scaffold_controller, :required => true

Expand Down
14 changes: 14 additions & 0 deletions railties/test/generators/scaffold_generator_test.rb
Expand Up @@ -276,6 +276,20 @@ def test_scaffold_generator_no_assets
assert_no_file "app/assets/stylesheets/posts.css"
end

def test_scaffold_generator_no_assets
run_generator [ "posts", "--assets=false" ]
assert_file "app/assets/stylesheets/scaffold.css"
assert_no_file "app/assets/javascripts/posts.js"
assert_no_file "app/assets/stylesheets/posts.css"
end

def test_scaffold_generator_no_assets
run_generator [ "posts", "--resource-route=false" ]
assert_file "config/routes.rb" do |route|
assert_no_match(/resources :posts$/, route)
end
end

def test_scaffold_generator_no_stylesheets
run_generator [ "posts", "--no-stylesheets" ]
assert_no_file "app/assets/stylesheets/scaffold.css"
Expand Down

0 comments on commit 927a04d

Please sign in to comment.