aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-1/+0
| | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* Make generated test work even when using virtual attributesyuuji.yaginuma2019-05-051-2/+7
| | | | | | | | | The virtual attributes(`attachment` and `rich_text`) can't set value with `fill_in`. So avoid using it. Once #35885 is merged, will be modified to use it. Also, add checking attachment attached or not for avoiding `DelegationError` when attachment didn't attach.
* Fix warning: shadowing outer local variable - attributeRyuta Kamizono2018-12-131-1/+1
|
* Fix boolean interaction in scaffold system testsGannon McGibbon2018-12-121-0/+5
|
* Allow `false` for `config.generators.system_tests=`bogdanvlviv2018-01-181-1/+1
| | | | | Mention `config.generators.system_tests` in the "Configuring Rails Applications" guide.
* [Railties] require_relative => requireAkira Matsuda2017-10-211-2/+2
| | | | This basically reverts 618268b4b9382f4bcf004a945fe2d85c0bd03e32
* Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-141-0/+2
|
* [Railties] require => require_relativeAkira Matsuda2017-07-011-2/+2
|
* Add system tests to generate scaffoldDinah Shi2017-06-301-4/+15
|
* Fix generator command for nested (namespaced) rails engine (take 2)Fumiaki MATSUSHIMA2017-01-071-1/+1
| | | | | | | | | | | | | | | | | | | Rewrite https://github.com/rails/rails/pull/27550 085546df45 was reverted (b6ffb5efcb) because it change the return of `namespaced_path` from String to Array. ---------------- If we create nested (namespaced) rails engine such like bukkits-admin, `bin/rails g scaffold User name:string age:integer` will create `bukkits-admin/app/controllers/bukkits/users_controller.rb` but it should create `bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`. In #6643, we changed `namespaced_path` as root path because we supposed application_controller is always in root but nested rails engine's application_controller will not.
* Revert "Merge pull request #27550 from ↵Rafael Mendonça França2017-01-031-1/+1
| | | | | | | | | mtsmfm/fix-generator-command-for-nested-rails-engine" This reverts commit 1e969bfb98b88799e2c759fce25a1d8cf00d7ce7, reversing changes made to a5041f267ded119c2d00b8786c2f2c1e3f93c8a1. Reason: It breaks the public API
* Fix generator command for nested (namespaced) rails engineFumiaki MATSUSHIMA2017-01-031-1/+1
| | | | | | | | | | | | | If we create nested (namespaced) rails engine such like bukkits-admin, `bin/rails g scaffold User name:string age:integer` will create `bukkits-admin/app/controllers/bukkits/users_controller.rb` but it should create `bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`. In #6643, we changed `namespaced_path` as root path because we supposed application_controller is always in root but nested rails engine's application_controller will not.
* applies new string literal convention in railties/libXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* fix NoMethodError that occurs when generating scaffold inside full mode engineyuuji.yaginuma2015-06-281-1/+1
|
* Fix class_option description for api generatorsSantiago Pastorino2015-06-111-1/+1
|
* API apps scaffold generator generates an apropriate controllerSantiago Pastorino2015-06-111-1/+5
|
* Merge pull request #20387 from y-yagi/fix_engine_generated_controller_testYves Senn2015-06-021-0/+9
|\ | | | | | | set engine's route in the functional test is generated in the engine
| * add engine's namespace to fixture nameyuuji.yaginuma2015-05-311-0/+9
|/
* Add support for generate scaffold password:digestSam Ruby2013-03-131-1/+5
| | | | | | | | | | * adds password_digest attribute to the migration * adds has_secure_password to the model * adds password and password_confirmation password_fields to _form.html * omits password entirely from index.html and show.html * adds password and password_confirmation to the controller * adds unencrypted password and password_confirmation to the controller test * adds encrypted password_digest to the fixture
* Extract a attributes_names method to avoid duplicationRafael Mendonça França2012-12-101-12/+4
|
* Deal with polymorphic attributes correctly in the generatorsRafael Mendonça França2012-12-101-5/+11
|
* Put the reference and belongs_to attributes in the scaffold tests.Rafael Mendonça França2012-12-101-6/+3
|
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-2/+2
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-10-111-3/+3
|\ | | | | | | | | | | Conflicts: activerecord/lib/active_record/persistence.rb railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb
| * nodoc TestUnit::Generators [ci skip]Francesco Rodriguez2012-10-071-3/+3
| |
* | Update test locationsMike Moore2012-10-091-1/+1
|/ | | | | | | | | | | | | | Change the default test locations to avoid confusion around the common testing terms "unit" and "functional". Add new rake tasks for the new locations, while maintaining backwards compatibility with the old rake tasks. New testing locations are as follows: app/models -> test/models (was test/units) app/helpers -> test/helpers (was test/units/helpers) app/controllers -> test/controllers (was test/functional) app/mailers -> test/mailers (was test/functional)
* Remove unused generator options. This was added for the removed rails new --httpSantiago Pastorino2012-04-181-3/+0
|
* Remove --http.José Valim2012-03-141-4/+2
|
* Generate special controller and functional test templates for http appsCarlos Antonio da Silva2012-03-141-1/+6
| | | | | | | | | | | | The main goal is to not generate the format.html block in scaffold controller, and to generate a different functional test as we don't rely on redirects anymore, we should test for http responses. In addition to that, the :edit action is removed from the http controller and the edit route is not generated by default, as they usually do not make sense in this scenario. [Carlos Antonio da Silva & Santiago Pastorino]
* Remove key_value helper now that master is 1.9 only and we always useRafael Mendonça França2012-03-131-5/+1
| | | | the 1.9 hash syntax in the generators.
* Refactor the test_unit scaffold generator to use the key_value methodRafael Mendonça França2012-03-131-1/+1
|
* Use the attributes hash explicitlyRafael Mendonça França2012-03-131-3/+16
|
* Do not use the attributes hash in the scaffold functional testsRafael Mendonça França2012-03-121-0/+8
|
* Remove the --singeleton option from scaffold generator.Prem Sichanugrist2010-06-241-1/+0
| | | | | | | | It turned out to be that scaffold for singeleton resource will always depend on another model, and it's not possible at the moment to make the application tests pass after generate the singeleton scafold. So, it would be better to remove it for now and probably provide another generator, such as singeleton_scaffold, in which also require the depended model name. [#4863 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Load generators from both lib/rails/generators and lib/generators. Using the ↵José Valim2010-03-231-0/+18
| | | | former since it's less obstrusive.
* Generators load path now will be Ruby load path. If you want to use ↵José Valim2010-01-181-18/+0
| | | | rspec:install generator, you need generators/rspec/install_generator in your load path.
* Move railties/lib/* into railties/lib/*Yehuda Katz + Carl Lerche2009-09-241-0/+18