Commit Graph

710 Commits

Author SHA1 Message Date
slainer68
2eacdb0cbf Require ActiveJob in case a skip_xxx option is given
Change position of require active_job
2014-08-20 18:08:41 +02:00
Rafael Mendonça França
76883f9237 Merge pull request #16062 from sgrif/sg-required-generators
Add a `required` option to the model generator
2014-08-17 22:57:21 -03:00
Sean Griffin
ea3ba34506 Change the default null value for timestamps
As per discussion, this changes the model generators to specify
`null: false` for timestamp columns. A warning is now emitted if
`timestamps` is called without a `null` option specified, so we can
safely change the behavior when no option is specified in Rails 5.
2014-08-12 14:40:11 -06:00
Arun Agrawal
301b5fd522 Fixes test for Gemfile entry changes
Broken by fbe38c9e9d4fe9f82518e8ffc1d757459b0c5f1c
2014-08-08 19:50:25 +02:00
Sean Griffin
fdfc0fc6c9 Add a required option to the model generator
Syntax was chosen to follow the passing of multiple options to
decimal/numeric types. Curly braces, and allowing any of `,`, `.`, or
`-` to be used as a separator to avoid the need for shell quoting. (I'm
intending to expand this to all columns, but that's another PR.

The `required` option will cause 2 things to change. `required: true`
will be added to the association. `null: false` will be added to the
column in the migration.
2014-08-08 10:29:27 -06:00
Yves Senn
a819211984 Merge pull request #16359 from skanev/after-bundle-in-rails-templates
Add an after_bundle callback in Rails templates

Conflicts:
	railties/CHANGELOG.md
2014-08-06 08:49:00 +02:00
José Valim
e5e4d08450 Bring back the helpers tests
Also keep the hook as other tools may rely on it,
we just don't do anything by default on Rails.
2014-08-05 14:04:30 +02:00
David Heinemeier Hansson
e5632f37f7 A few more tests asserting the presence of helper test stubs 2014-08-03 15:12:27 -07:00
David Heinemeier Hansson
a1ede5a441 Stubs are no longer generated for helpers, so dont test for it 2014-08-03 14:59:24 -07:00
David Heinemeier Hansson
a34b6649d0 Generating stubs for helper tests is overly specific. Most helpers should simply be tested as part of the view thats using them. If you need something beyond that, you can add a test yourself for them 2014-08-03 14:50:50 -07:00
Stefan Kanev
097b210189 Add an after_bundle callback in Rails templates
The template runs before the generation of binstubs – this does not
allow to write one, that makes an initial commit to version control.
It is solvable by adding an after_bundle callback.
2014-08-03 00:29:29 +02:00
Carlos Antonio da Silva
811604f3f7 Avoid defining the test if it does not need to when not on JRuby 2014-07-30 23:41:19 -03:00
Carlos Antonio da Silva
72c96dea2d Use default argument when testing generators without the need for extra args 2014-07-30 23:41:19 -03:00
Carlos Antonio da Silva
bfc2b23128 Simplify path setup 2014-07-30 23:41:18 -03:00
Carlos Antonio da Silva
9023e3b773 Simplify plugin tests a bit, leave the regexp work for minitest 2014-07-30 23:41:18 -03:00
Carlos Antonio da Silva
c8c8fe98b3 Invert unless..else conditions on JRuby checks 2014-07-30 23:41:18 -03:00
Santiago Pastorino
4efb36e7b4 Revert "Merge pull request #15305 from tgxworld/remove_unnecessary_require"
This reverts commit f632f79b8dcd144408c66a544984b2ba9cf52f87, reversing
changes made to 98c7fe87690ca4de6c46e8f69806e82e3f8af42d.

Closes #16343
2014-07-30 09:46:33 -03:00
Robin Dupret
558f8aa2ee Set Psych as the YAML engine for Rubinius
Since the rubysl-yaml gem doesn't ship with Psych by default because of
its dependency on libyaml, on Rubinius, the default engine is Syck.

However, if we want to be able to run the application safely on
different rubies, we need to make people using Rubinius rely on Psych.

See http://git.io/uuLVag for further information.
2014-07-23 20:05:14 +02:00
Rafael Mendonça França
08754f12e6 Merge branch 'rm-remove-mocha'
Conflicts:
	actionpack/test/abstract_unit.rb
2014-07-19 18:17:13 -03:00
Rafael Mendonça França
fd6aaaa0c3 Stop requiring mocha automatically
We are planning to remove mocha from our test suite because of
performance problems. To make this possible we should stop require mocha
on ActionSupport::TestCase.

This should not affect applications since users still need to add mocha
to Gemfile and this already load mocha.

Added FIXME notes to place that still need mocha removal
2014-07-19 17:35:12 -03:00
Rafael Mendonça França
3121412cf1 Keep quietly and capture undeprecated on your suite 2014-07-15 17:56:27 -03:00
Arun Agrawal
e197fd7f37 Display notice in index.html pages in scaffolded generated views
As we are setting notice in destroy action we should display that

For more information see https://github.com/rails/rails/pull/14044
And https://github.com/rails/jbuilder/pull/191

closes #14044
2014-07-04 16:20:53 +02:00
Lucas Mazza
4b173b8ed9 Add a '--skip-routes' flag for the Controller generator.
This way it is possible to skip the addition of the 'get "foo/bar"' routes when
generating a controller.
2014-06-24 14:06:03 -03:00
Rafael Mendonça França
1056589580 Add a generic --skip-gems options to generator
Also remove --skip-turbolinks.

This option is useful if users want to remove some gems like jbuilder,
turbolinks, coffee-rails, etc that don't have specific options on the
generator.

    rails new my_app --skip-gems turbolinks coffee-rails
2014-06-17 20:35:09 -03:00
Marc Schütz
e3dca3acc6 Add an option to skip installation of Turbolinks 2014-06-14 12:03:09 +02:00
Yves Senn
75f75a8719 Merge pull request #14881 from robin850/patch-19
Swallow bundler exceptions when running tests
2014-06-01 18:23:10 +02:00
Yves Senn
7ba6b75910 bin/setup script to bootstrap applications. 2014-05-30 11:15:56 +02:00
Yves Senn
83cb356093 Merge pull request #15327 from alexbel/replace_double_quotes_with_single_quotes
Replace double quotes with single quotes while adding an entry into Gemfile
2014-05-27 09:27:36 +02:00
alexbel
6aaf4bff18 Replace double quotes with single quotes while adding an entry into Gemfile 2014-05-26 19:08:03 -04:00
Guo Xiang Tan
4ca5a5ea67 Remove unnecessary require of Minitest.
Minitest has already been required when calling Minitest.autorun.
2014-05-24 20:36:05 -07:00
Rafael Mendonça França
31fb1ef536 New applications should be created with json serializer
The fix introduced at 75ba7425f6d235f254c00a45a58f42e88f80301a were
missing this case.

To fix the original issue mentioned at that commit the correct is to
remove update_config_files from the command list since we should not run
both config_files command when creating a new application.

Tests were added to make sure everything is working fine.
2014-05-17 15:46:33 -03:00
Christian Wesselhoeft
75ba7425f6 Fix app generator test hanging. 2014-05-17 09:53:44 -07:00
Josemar Luedke
08b435e1bd Change Gemfile’s double quotes in plugin generator
Since the generated application’s Gemfile is using single quotation marks, it
seems fair to use it on plugin’s Gemfile as well.
2014-05-10 17:56:16 -03:00
Vipul A M
b2437050c8 rename str to string to fix overshadowing of variable 2014-05-07 14:32:27 +05:30
Arun Agrawal
c694c8e25c skip-git should not hit git commands plugin generators 2014-05-02 15:38:58 +02:00
Roman Shmatov
e8c310edf6 Works correctly if git not installed 2014-05-02 15:38:56 +02:00
Robin Dupret
48b3257582 Swallow bundler exceptions when running tests
Let's avoid useless output when testing stuff related to Bundler.
2014-04-27 18:25:16 +02:00
Rafael Mendonça França
7bb8fd2f64 Merge pull request #14646 from deivid-rodriguez/provide_byebug_by_default
Improve debugging support
2014-04-11 13:55:10 -03:00
Matthew Draper
f612c2b052 Move assets precompile (and version) to an initializer
sprockets-rails 2.1 needs the precompile list to be available in all
environments.
2014-04-11 22:47:54 +09:30
David Heinemeier Hansson
4b0c8a9467 Use short-form for the scaffold render calls and drop the needless test 2014-04-08 20:57:24 +02:00
David Rodríguez de Dios
d8a4e48220 Update Gemfile templates to provide correct debugger 2014-04-08 20:57:12 +02:00
Rafael Mendonça França
8a081db357 Fix build with bundler 1.6 2014-03-26 22:19:29 -03:00
Kuldeep Aggarwal
5a3817cb16 Fix Generation of proper migration when
ActiveRecord::Base.pluralize_table_names = false.

  Previously, generation a migration like this:

      rails g migration add_column_name_to_user name

  would not generating the correct table name.

Fixes #13426.
2014-03-25 20:27:37 +05:30
Rafael Mendonça França
b9440c36dd Check if any sqlite files are not included in the gitignore
If the sqlite file name change in future version we this regexp should
catch
2014-03-24 09:24:47 -03:00
Dmitrii Golub
f42c7eee7e Remove sqlite3 lines from .gitignore if the application is not using sqlite3. 2014-03-24 14:53:38 +04:00
schneems
aa27766e2f better test error messages 2014-03-14 11:40:14 -05:00
Guillermo Iguaran
b0767afac5 Merge pull request #14195 from robin850/issue-14079
Avoid namespacing routes inside engines
2014-02-28 19:26:04 -05:00
Yves Senn
14e697cf2a Merge pull request #14174 from kuldeepaggarwal/fix-resource_generator_test
fix test cases
2014-02-27 18:57:45 +01:00
Kuldeep Aggarwal
adff19cc3b modify model generator warning message. refs [#174c9f0] 2014-02-27 22:04:01 +05:30
Robin Dupret
fc61bca31d Avoid namespacing routes inside engines
Since #11544, invoking the controller generator, any generated route is
namespaced according to the class_path method. Since a mountable plugin
is namespaced, creating a controller inside would generate a namespaced
route based on the engine's name.

The controller generator now relies on regular_class_path which does not
contain the class hierarchy but the given path.

Fixes #14079.
2014-02-26 16:06:11 +01:00