Commit Graph

10365 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
9892d445bc Merge pull request #18378 from shunsukeaida/avoid_orm_being_humanized_in_generator_help_message
Overwrite descriptions generated by Generators::Base to respect acronym.
2015-01-07 09:27:17 -02:00
Nobuyoshi Nakada
92b19006a7 Use EXEEXT
Use the configured variable EXEEXT, instead of hardcoded suffix and
platform names.

And on such platforms, files which do not end with the suffix are not
executable, so the original names are not necessary, in general.
2015-01-07 14:50:19 +09:00
shunsukeaida
884d123e13 acronyms like ORM should be in uppercase, so overwrite the desc generated by hook_for 2015-01-07 13:04:57 +09:00
Carlos Souza
5697bdbb6d Add mailer suffix to generated files and classes
Following the same naming convention used in
controllers and jobs.
2015-01-06 10:46:22 -05:00
Rafael Mendonça França
21f02f3485 Remove some comments about Ruby 1.9 behaviors 2015-01-04 15:55:28 -03:00
Rafael Mendonça França
93559da482 Remove debugger support
bebugger doesn't work with Ruby 2.2 so we don't need to support it
anymore
2015-01-04 15:54:22 -03:00
claudiob
185d7cdb42 Remove Psych hack for Ruby 1.9
A special `if` statement to support `Psych` for Ruby < 2.0 can be
dropped now that Rails requires Ruby >= 2.0.
2015-01-04 15:54:21 -03:00
Rafael Mendonça França
526e5e845a Fix CHANGELOG [ci skip] 2015-01-04 12:35:05 -03:00
Rafael Mendonça França
f663132eef Remove deprecated test:all and test:all:db tasks 2015-01-04 12:11:03 -03:00
Rafael Mendonça França
c564dcb75c Remove deprecated Rails::Rack::LogTailer 2015-01-04 12:11:03 -03:00
Rafael Mendonça França
b7f856ce48 Remove deprecated RAILS_CACHE constant 2015-01-04 12:11:03 -03:00
Rafael Mendonça França
463b5d7581 Remove deprecated serve_static_assets configuration 2015-01-04 12:11:02 -03:00
Rafael Mendonça França
c2e865849b Remove deprecation warning when log_level is not explicit set on production 2015-01-04 12:11:02 -03:00
Rafael Mendonça França
07d3d40234 Change transaction callbacks to not swallowing errors.
Before this change any error raised inside a transaction callback
are rescued and printed in the logs.

Now these errors are not rescue anymore and just bubble up,
as the other callbacks.
2015-01-04 11:58:44 -03:00
Rafael Mendonça França
a939506f29 Change the default null value for timestamps to false 2015-01-04 11:58:43 -03:00
Rafael Mendonça França
d282125a18 Remove deprecate *_path helpers in email views 2015-01-04 11:58:42 -03:00
Rafael Mendonça França
481e49c64f Remove deprecated methods at Kernel.
`silence_stderr`, `silence_stream`, `capture` and `quietly`.
2015-01-04 11:58:40 -03:00
Carlos Antonio da Silva
217e5f6e4a Improve the matches on the scaffold generator tests
Related to #13434.
2015-01-03 20:30:31 -02:00
Carlos Antonio da Silva
1468a11f9b Merge pull request #13434 from tanraya/local_variables
Use local variables in _form.html.erb generated by scaffold.

Conflicts:
	railties/CHANGELOG.md
2015-01-03 20:20:05 -02:00
Rafael Mendonça França
4591b0fc04 Merge pull request #17227 from claudiob/explicitly-abort-callbacks
Introduce explicit way of halting callback chains by throwing :abort. Deprecate current implicit behavior of halting callback chains by returning `false` in apps ported to Rails 5.0. Completely remove that behavior in brand new Rails 5.0 apps.

Conflicts:
	railties/CHANGELOG.md
2015-01-03 17:22:20 -03:00
Rafael Mendonça França
900758145d Remove some warnings 2015-01-03 17:17:47 -03:00
Robin Dupret
1fd44213aa Remove the tmp/sessions folder and its clear task
Commit 1aea470 introduced this directory but this was at a time when the
default way to store sessions was on the file system under the tmp
directory.

Let's remove references to it from the documentation as well.

[Robin Dupret & yui-knk]
2015-01-03 19:42:07 +01:00
Vijay Dev
4b9dba99d6 Merge branch 'master' of github.com:rails/docrails 2015-01-03 14:58:17 +00:00
Rafael Mendonça França
a699f5d3e1 Merge pull request #18309 from PaBLoX-CL/fix-fixtures-references
Generated fixtures won't use parent_id when generated with
parent:references
2015-01-02 23:02:53 -03:00
Pablo Olmos de Aguilera Corradini
9405ecdd98 Generated fixtures won't use parent_id when generated with parent:references
Fix #18301
2015-01-02 23:01:24 -03:00
claudiob
9c65c539e2 Add config to halt callback chain on return false
This stems from [a comment](rails#17227 (comment)) by @dhh.
In summary:

* New Rails 5.0 apps will not accept `return false` as a way to halt callback chains, and will not display a deprecation warning.
* Existing apps ported to Rails 5.0 will still accept `return false` as a way to halt callback chains, albeit with a deprecation warning.

For this purpose, this commit introduces a Rails configuration option:

```ruby
config.active_support.halt_callback_chains_on_return_false
```

For new Rails 5.0 apps, this option will be set to `false` by a new initializer
`config/initializers/callback_terminator.rb`:

```ruby
Rails.application.config.active_support.halt_callback_chains_on_return_false = false
```

For existing apps ported to Rails 5.0, the initializers above will not exist.
Even running `rake rails:update` will not create this initializer.

Since the default value of `halt_callback_chains_on_return_false` is set to
`true`, these apps will still accept `return true` as a way to halt callback
chains, displaying a deprecation warning.

Developers will be able to switch to the new behavior (and stop the warning)
by manually adding the line above to their `config/application.rb`.

A gist with the suggested release notes to add to Rails 5.0 after this
commit is available at https://gist.github.com/claudiob/614c59409fb7d11f2931
2015-01-02 15:31:56 -08:00
claudiob
93dd5028a0 Loosen test about order of initializers
This commit modifies the code (but not the purpose) of a test that checks that

> initializers are executed after application configuration initializers

Currently the test hard-codes the *exact* initializers that are expected to
occur before a custom one. This can cause the test to fail even if the
expectation still passes.

This commit loosens the test by simply checking that, in the array of
initializers, the custom initializers (called `dummy_initializer` in the
example) is executed after the last occurrence of `load_config_initializers`.
2015-01-02 15:31:33 -08:00
Carlos Antonio da Silva
b63382ec06 Remove warnings
warning: ambiguous first argument; put parentheses or a space even after
    `/' operator'`
2015-01-02 10:29:57 -02:00
Carlos Antonio da Silva
120bf7444f Verify the helper name with plural as it is generated
Thanks @robin850.
2015-01-02 10:29:36 -02:00
claudiob
b6f50b3fa8 Add --skip-action-mailer (or -M) to rails generate 2015-01-01 18:46:12 -08:00
Rafael Mendonça França
4ba0e2fc22 Fix scaffold generator with --helper=false option 2015-01-01 23:16:30 -03:00
Rafael Mendonça França
ac0a8eec62 Fix test description to match the test behaviour 2015-01-01 22:44:30 -03:00
Arun Agrawal
4de18d0ead Update copyright notices to 2015 [ci skip] 2014-12-31 08:34:14 +01:00
Prathamesh Sonpatki
3f9598d491 Fix description for application_name method - change simple to simply
[ci skip]
2014-12-30 22:30:04 +05:30
Rafael Mendonça França
d233220f29 Merge pull request #18240 from shunsukeaida/add_tzinfo_data_to_plugin_gemfile
plugin's gemfile also needs tzinfo-data in Windows
2014-12-29 16:12:19 -03:00
Rafael Mendonça França
156c657731 Remove some warning with Ruby 2.2 2014-12-29 16:09:59 -03:00
ShunsukeAida
31f3167be0 plugin's gemfile also needs tzinfo-data in Windows 2014-12-30 01:57:29 +09:00
Guillermo Iguaran
edaab4dbe8 Merge pull request #18209 from claudiob/bump-to-2-2
Require Ruby 2.2 for Rails 5.0
2014-12-28 16:39:39 -05:00
Alex Robbin
4e0ec961e1 actually autoload all second-level directories called app/*/concerns 2014-12-26 23:21:20 -05:00
claudiob
d3b098b828 Require Ruby 2.2 for Rails 5.0
Stems from [this comment](https://github.com/rails/rails/pull/18203#issuecomment-68138096) by @robin850
and by the blog post http://weblog.rubyonrails.org/2014/12/19/Rails-4-2-final
2014-12-26 13:53:09 +01:00
Vipul A M
1faa00c9ec - Changed paths to routing_paths to avoid warning possible reference to past scope 2014-12-26 10:38:00 +05:30
Kenta Okamoto
9b67735de9 Remove unnecessary double space 2014-12-26 13:27:23 +09:00
Sean Griffin
a0e34619b8 Merge pull request #18170 from tgxworld/add_docs_for_rails_application_secrets
[ci skip]
2014-12-23 09:44:12 -07:00
Guo Xiang Tan
2f7b72b793 Rails::Application#secrets should be documented. 2014-12-24 00:32:31 +08:00
Sean Griffin
b7d7e0b15e Add test missed by a03ea684efc3505647cf0327a501aa2dbb591ad2 2014-12-22 14:05:35 -07:00
Sean Griffin
a03ea684ef Use the new foreign_key option on references in generators
Changes `rails g model Post user:references` from

    def change
      create_table :posts do |t|
        t.references :user, index: true
      end

      add_foreign_key :posts, :users
    end

to

    def change
      create_table :posts do |t|
        t.references :user, index: true, foreign_key: true
      end
    end

Changes `rails g migration add_user_to_posts user:references` from

    def change
      add_reference :posts, :users, index: true
      add_foreign_key :posts, :users
    end

to

    def change
      add_reference :posts, :users, index: true, foreign_key: true
    end
2014-12-22 13:47:11 -07:00
Sean Griffin
9fff631a06 Skip byebug on all non-MRI rubies, fix tests
The changes in #18149 added tests for the app generator, but only fixed
it for the plugin generator (I should have let CI finish though I think
it would have failed as an allowed failure).
2014-12-22 13:43:58 -07:00
Arthur Neves
0bb73f03e4
Only add debugger/byebug if on MRI 2014-12-22 15:27:56 -05:00
rochefort
2114e6bf29 Fix typo in nodoc 2014-12-22 17:14:58 +09:00
claudiob
a770d7e404 Add docs for Rails.env and Rails.env=
[ci skip]
2014-12-22 03:44:37 +01:00
Xavier Noria
83bbc2352c prefer single quotes, by the beard of the prophet! 2014-12-20 00:51:30 +01:00
Tim Pope
1ae88b84a6 Make bin/setup portable 2014-12-19 18:36:53 -05:00
Godfrey Chan
2d04bdd86f Merge pull request #18100 from chancancode/serve_static_files
Allow static asset serving from env variable (enhanced!)
Conflicts:
	railties/CHANGELOG.md
2014-12-19 14:55:34 -08:00
Yves Senn
36ce0c2c82 db:structure:load and db:schema:load no longer purge the database.
Closes #17945

`db:test:prepare` still purges the database to always keep the test
database in a consistent state.

This patch introduces new problems with `db:schema:load`. Prior
to the introduction of foreign-keys, we could run this file against
a non-empty database. Since every `create_table` containted the
`force: true` option, this would recreate tables when loading the schema.

However with foreign-keys in place, `force: true` wont work anymore and
the task will crash.

/cc @schneems
2014-12-18 10:08:17 +01:00
Rafael Mendonça França
efbbb30534 Merge pull request #18049 from yuki3738/fix_rails_db_command_error
Add a code checking about file or not to the rails db command
2014-12-16 15:12:21 -02:00
George Millo
d75773ada0 English fix [ci skip] 2014-12-16 14:32:06 +00:00
yuki3738
17bb531f82 Add a code checking about file or not to the rails db command 2014-12-16 19:28:00 +09:00
NorimasaAndo
8493f44976 Fix Duplicate web-console entries in Gemfile 2014-12-14 21:25:26 +09:00
Rafael Mendonça França
83534e5678 New applications should use sass-rails 5.0 2014-12-12 20:48:44 -02:00
Rafael Mendonça França
193ec360b1 Rails master requires arel master 2014-12-12 18:49:45 -02:00
Godfrey Chan
46617f02c6 Align the GemfileEntry API with stable branches
See 63462ec
2014-12-12 11:23:17 -08:00
yui-knk
083505a7d6 [ci skip] Fix typo 2014-12-09 13:02:03 +09:00
Rafael Mendonça França
c8284c8025 Merge pull request #17896 from GBH/globbing_route_mailer_preview
fixing mailer previews for apps with globbing route
2014-12-08 15:10:47 -02:00
Rafael Mendonça França
78504600f5 Merge pull request #17953 from kirs/test-activejob-generator
Test coverage for ActiveJob generator
2014-12-08 14:31:37 -02:00
Kir Shatrov
1bf42df031 Test coverage for ActiveJob generator 2014-12-07 08:29:12 +03:00
Sam Ruby
8275b65987 Use latest web-console when using --dev or --edge
Fixes:

http://intertwingly.net/projects/AWDwR4/checkdepot-215/makedepot.log
2014-12-05 11:18:18 -05:00
Rafael Mendonça França
da13b9aedc Merge pull request #17797 from y-yagi/donot_delete_mailer_layouts
Don't remove mailer layouts files
2014-12-04 18:29:50 -02:00
Oleg
ccc3ddb776 fixing mailer previews for apps with globbing route 2014-12-03 10:43:12 -05:00
Prathamesh Sonpatki
05a6fafdd5 Removed use of mocha in the info_controller tests 2014-12-03 10:06:02 +05:30
Melissa Xie
3b43d1d822 Fix "nonexistent" typo in tests 2014-12-02 19:19:10 -05:00
Akira Matsuda
ae54cb29d4 require 'rake' before requiring Rake tasks
Without this,
% rails r "require 'rails/tasks'"
would cause a NoMethodError: undefined method `desc' for main:Object
2014-12-03 06:28:09 +09:00
Guo Xiang Tan
106db0b419 Silence Minitest for plugin tests.
Fixes https://github.com/rails/rails/issues/17340.

Use Minitest::BacktraceFilter instead of removing all silencers. This
will allow the backtrace for all libraries in the plugin to be shown
while removing noise generated by Minitest's backtrace.
2014-12-02 18:47:03 +08:00
Santiago Pastorino
cd77755ae4 Merge pull request #17866 from bogdan/default-form-builder
Bugfix config.action_view.default_form_builder option
2014-12-01 18:01:49 -02:00
Bogdan Gusiev
a04c061961 Bugfix config.action_view.default_form_builder option 2014-12-01 18:23:00 +02:00
Sam
6edc26f47e FIX: absolute_path may be nil for code added via instance_eval 2014-12-01 12:35:16 +11:00
Sean Griffin
5493d16d9e Merge pull request #17823 from byroot/fix-mount-rack-apps-with-as
Pure rack apps can be mounted with a name
2014-11-29 15:31:12 -07:00
Jean Boussier
f413cbee8d Pure rack apps can be mounted with a name
See 9b15828b5c (commitcomment-8764492)
2014-11-29 09:24:43 -05:00
Erik Michaels-Ober
d1374f99bf Pass symbol as an argument instead of a block 2014-11-29 11:53:24 +01:00
Xavier Noria
56e47cf66d adds missing period in test.rb [ci skip] 2014-11-29 08:48:23 +01:00
claudiob
96d0f751f9 Bump required Ruby version to 2.1.0
[This article](http://weblog.rubyonrails.org/2014/8/20/Rails-4-2-beta1/#maintenance-consequences-and-rails-5-0) states that:

> Rails 5.0 is in most likelihood going to target Ruby 2.2.

Before the exact minimum version is fully decided, @arthurnn [suggests](https://github.com/rails/rails/pull/17830#issuecomment-64940383)
that **at least** version 2.1.0 **must** be required by the `gemspec` files.
2014-11-28 22:59:51 -08:00
Rafael Mendonça França
c6bd5284b3 We don't need to use sass-rails 5.0.0.beta 2014-11-28 15:15:30 -02:00
Rafael Mendonça França
f25ad07f5a Start Rails 5 development 🎉
We will support only Ruby >= 2.1.

But right now we don't accept pull requests with syntax changes to drop
support to Ruby 1.9.
2014-11-28 15:00:06 -02:00
Yves Senn
6c83d4bfd5 docs, AR no longer makes use of test:prepare. [ci skip]
Change originated from https://github.com/rails/rails/pull/17739#issuecomment-64829088

/cc @metaskills
2014-11-28 11:05:13 +01:00
Santiago Pastorino
31815d7167 Revert "Test against rack master"
This reverts commit 2a4e14db981e38611667d407a975600ee720ada7.
2014-11-27 16:53:58 -02:00
Xavier Noria
4eefa1a0ac rails -> bin/rails in index.html 2014-11-27 00:45:16 -08:00
yuuji.yaginuma
f9411b464d Don't remove mailer layouts files 2014-11-27 14:36:10 +09:00
Rafael Mendonça França
2a4e14db98 Test against rack master 2014-11-26 16:17:51 -02:00
Yves Senn
683b476b45 Merge pull request #17761 from pschrammel/master
be more general with adapter name
2014-11-26 15:20:25 +01:00
Rafael Mendonça França
1a35f907a9 Merge pull request #17782 from cheba/engine-root-master
Use absolute_path of caller_locations to infer engine root
2014-11-26 11:49:21 -02:00
Juan Ignacio Pumarino
3766015f07 Provide support for SQL Server connections with dbconsole using sqsh 2014-11-26 10:36:54 -03:00
Alexander Mankuta
f2b17231ba Use absolute_path of caller_locations to infer engine root
According to documentation `path` only returns file names. On MRI it's
not the case but it's likely a bug in MRI.
2014-11-26 13:47:09 +02:00
Rafael Mendonça França
75eacb00e0 Use jquery-rails 4.0.0 2014-11-25 22:34:10 -02:00
Sean Griffin
807d61dc8b Merge pull request #17773 from gsamokovarov/mention-web-console-2.0-rc1
Use web_console 2.0 for 4.2.0.rc1 release
2014-11-25 17:26:45 -07:00
Genadi Samokovarov
7f864ccd65 Use web_console 2.0 for 4.2.0.rc1 release
This one replaces the notable web-console mentions in guide and the
default Gemfile.
2014-11-26 02:10:05 +02:00
Derek Prior
323334a775 Generators add foreign keys on references
If you run a generator such as:

```
rails generate model accounts supplier:references
```

The resulting migration will now add the corresponding foreign key
constraint unless the reference was specified to be polymorphic.
2014-11-25 20:22:58 -02:00
Rafael Mendonça França
ac0432cf35 Fix syntax error 💣 2014-11-25 20:16:09 -02:00
Rafael Mendonça França
e3f7817cec Use released rails-dom-testing 2014-11-25 19:43:36 -02:00
Yves Senn
5c4495538b bring back db:test:prepare.
This reverts deprecations added in #13528.
The task is brought back for two reasons:
  1. Give plugins a way to hook into the test database initialization process
  2. Give the user a way to force a test database synchronization

While `test:prepare` is still a dependency of every test task, `db:test:prepare`
no longer hooks into it. This means that `test:prepare` runs before the schema
is synchronized. Plugins, which insert data can now hook into `db:test:prepare`.

The automatic schema maintenance can't detect when a migration is rolled-back,
modified and reapplied. In this case the user has to fall back to `db:test:prepare`
to force the synchronization to happen.
2014-11-25 18:17:01 +01:00
Yves Senn
7836e887d7 tests, run test_test.rb with RAILS_ENV=test.
The tests to verify our testing setup used `RAILS_ENV=development`
to execute the tests. Let's keep it as close to a real-world setup
as possible.
2014-11-25 13:56:29 +01:00
Godfrey Chan
f2a0567b31 Added tests for log_level deprecation
Closes #17756

[Godfrey Chan, Zachary Scott]
2014-11-25 03:05:42 -08:00
Godfrey Chan
6ea7065a18 Set the test_order in the basic app as well, see 58e8b48
This removes the unwanted deprecation warnings in the tests
2014-11-25 03:05:42 -08:00
Godfrey Chan
6f08eeb6e8 Set the default log_level to info in all tests
This is a follow-up to 116de07. That change was for two reasons: 1) speed up the
tests by reducing the amount of log lines 2) avoid a deprecation warning from
a6de6f5.

This setting need to be on the basic app too, otherwise the deprecation warning
will show up on other unrelated test cases.
2014-11-25 03:05:42 -08:00
Godfrey Chan
6b8cd6878e Merge pull request #17757 from zzak/railties-default-to-debug-log_level
Always default the log_level to :info for Railties
2014-11-25 01:55:20 -08:00
Godfrey Chan
6da69db9d8 Merge pull request #17755 from zzak/changelog-for-16622
Add a CHANGELOG entry for #16622 and a6de6f5 [ci skip]
2014-11-25 00:25:30 -08:00
Peter Schrammel
1c61b74ce2 be more general with adapter name 2014-11-25 08:56:01 +01:00
Zachary Scott
116de0731e Always default the log_level to :info for Railties 2014-11-24 19:07:42 -08:00
Guo Xiang Tan
7a47690a13 Generate mailer layouts even if no action is given. 2014-11-25 09:21:37 +08:00
Guo Xiang Tan
35628a44b2 MailerGenerator should inherit from Base. 2014-11-25 09:16:11 +08:00
Guo Xiang Tan
b8d8ce7ba8 Add tests which were incorrectly removed. 2014-11-25 09:14:59 +08:00
Zachary Scott
49f74fbc4d Add a CHANGELOG entry for #16622 and a6de6f5 [ci skip] 2014-11-24 16:13:25 -08:00
David Heinemeier Hansson
35362fc226 Merge pull request #17646 from andyjeffries/html_layout_fix
Creating mailer layouts by default, including html and body tags
2014-11-25 01:59:43 +03:00
Arthur Neves
8e1e9f6c70
Fix sprockets-rails dependency dance
- Remove sprockets-rails from generated Gemfile as rails has a hard-dependency on it

- Also allow sprockets-rails >= 2.0.0
2014-11-24 16:30:26 -05:00
Santiago Pastorino
48a8830587 Merge pull request #17737 from yui-knk/fix/head
Replace ActionDispatch::Head with Rack::Head.
2014-11-24 14:58:01 -02:00
Richard Littauer
746c3741e7 Fix wrong path in comments about stylesheets
I put the wrong path in my last PR by accident. Fixed here. Related to #17742
2014-11-24 10:26:01 -05:00
Richard Littauer
7b378403d3 Change 'of plugins' syntax
Currently, the docs uses a syntax that is unclear and not general
American English. I've switched it to be clearer wording. Not a big
fix, but may be helpful.
2014-11-24 10:22:44 -05:00
yui-knk
47ca6664fb Replace ActionDispatch::Head with Rack::Head. 2014-11-24 19:48:51 +09:00
Andy Jeffries
a58da25d90 Removing unnecessary File.join calls 2014-11-24 09:37:49 +00:00
Andy Jeffries
38cfaa8285 Creates an ApplicationMailer and layout by default, including html and body tags to reduce spam score 2014-11-21 16:46:49 +00:00
Yves Senn
8ffc8da713 ignore all logfiles but keep the log directory. #17700 [ci skip]
We generate a `.keep` file inside the log directory to make
sure the directory itself is under version control. let's keep
it that way.

/cc @matthewd
2014-11-21 09:26:58 +01:00
Yves Senn
36fe7f3bed Merge pull request #17700 from ShunsukeAida/ignore_log_as_a_whole
why not gitignore /log as a whole?

[ci skip]
2014-11-21 09:10:47 +01:00
Shunsuke Aida
f245fe856d if you want to ignore all the logfiles, no need for extensions 2014-11-21 11:52:44 +09:00
Rafael Mendonça França
916731686b Generate new applications with the right rails-dom-testing version 2014-11-17 16:44:15 -02:00
Guo Xiang Tan
1966ecf668 Fix typo. 2014-11-17 23:45:58 +08:00
Rafael Mendonça França
94de3979dd Merge pull request #17640 from michaeljayt/spring-not-working-in-cygwin
Skip spring install in Cygwin due to fork() bad support.
2014-11-17 11:51:42 -02:00
Rafael Mendonça França
e37edf1c6c Merge pull request #17645 from georgemillo/master
Minor English fixes in docs [ci skip]
2014-11-17 11:35:25 -02:00
Godfrey Chan
c7727559e1 Meant to describe the concept, not the setting [ci skip] 2014-11-17 04:23:00 -08:00
Godfrey Chan
a6de6f508c Deprecate different default for log_level in production
This is a more conservative approach to 2602a49. Also changed the comment to be
more inline with everything else in the file (describing what the config value
is doing and why). People should just read the docs for alternatives.
2014-11-17 04:19:49 -08:00
Godfrey Chan
402cc9f46a Revert "Merge pull request #16622 from matthewd/default-debug"
This reverts commit 2602a49a8600ab52f807599bbd5b1f9c0be4214f, reversing
changes made to 5d7c1057684c377bc2801c8851e99ff11ab23530.

The explicit default was introduced in 21f6d72, so apps created with Rails < 4
have the commented out version, which means that this change would break those
apps.
2014-11-17 03:42:00 -08:00
George Millo
6f57e1240e Minor English fixes in docs [ci skip] 2014-11-17 15:31:39 +07:00
michaeljayt
2cfaa22d38 Skip spring install in Cygwin due to fork() bad support.
See also: https://www.cygwin.com/faq.html#faq.using.fixing-fork-failures
2014-11-17 02:42:29 +08:00
Carlos Antonio da Silva
6ff78469cd Improve railties changelog entry and move latest to the top [ci skip] 2014-11-12 14:22:31 -02:00
Rafael Mendonça França
4cd146bae5 Merge pull request #17593 from igas/paths-unshift-arity
Fix Rails::Paths::Path.unshift interface
2014-11-12 12:51:02 -02:00
David Heinemeier Hansson
2a31ea5545 Merge pull request #17348 from DavidGeukers/rake_test_all
simplify rake test vs rake test:all
2014-11-12 13:42:17 +03:00
Igor Kapkov
56dc95bc92 Fix Rails::Paths::Path.unshift interface 2014-11-12 16:27:42 +08:00
David Geukers
3b12abba3c Simplify rake test vs rake test:all
Renames `rake test:all` to `rake test` by changing old `rake test:run` to previous version of `rake test:all`.  Removes old definition of `rake test`. Also renames `rake test:all:db` to `rake test:db` and deprecates `rake test:all` & `rake test:all:db`
2014-11-10 20:33:31 -05:00
claudiob
d4ce2bb06d Remove unnecessary double space
Replaces the following in two places:

```diff
-require ::File.expand_path('../config/environment',  __FILE__)
+require ::File.expand_path('../config/environment', __FILE__)
```
2014-11-10 22:29:45 -02:00
Rafael Mendonça França
bda93b2bb2 ✂️ 2014-11-10 21:19:37 -02:00
Rafael Mendonça França
1d1239d328 No need to sync config.secret_token and secrets.secret_token
Just prefer secrets over config
2014-11-10 21:18:57 -02:00
Rafael Mendonça França
091652cae8 Merge pull request #16535 from bf4/patch-1
Allow fallback to LegacyKeyGenerator when secret_key_base is not set but secrets.secret_token is
2014-11-10 20:38:46 -02:00
Rishi Jain
30af171af1 added description for rails generators, and fixed sentence formation for active_support/notifications [ci skip] 2014-11-10 08:11:49 +05:30
yui-knk
9cf3596da5 Fix comment of SourceAnnotationExtractor#find_in
Commit(810af6f) changed which extensions are taken into account,
so make to match comment of find_in.
And sort extensions to follow the added order.
2014-11-09 11:53:51 +09:00
Zachary Scott
001e600619 Documenting Rails::Info module [ci skip] 2014-11-08 16:40:13 -08:00
Arun Agrawal
9511801a6d Add test/jobs files in rake stats 2014-11-05 14:17:37 +01:00
Carlos Antonio da Silva
5da73d9181 Add skip-turbolinks entry to 4.2 release notes and improve changelog
[ci skip]
2014-11-05 08:36:14 -02:00
Aaron Patterson
9dbcac7811 add lib to $LOAD_PATH on application inhertence. fixes #17106 2014-11-04 14:54:52 -08:00
Aaron Patterson
0d5a384498 add a test for #17106 2014-11-04 14:14:03 -08:00
Benjamin Fleischer
db5f1a46f2 secret_token is now saved in Rails.application.secrets.secret_token
- `secrets.secret_token` is now used in all places `config.secret_token` was
  - `secrets.secret_token`, when not present in `config/secrets.yml`,
    now falls back to the value of `config.secret_token`
  - when `secrets.secret_token` is set, it over-writes
    `config.secret_token` so they are the same (for backwards-compatibility)
  - Update docs to reference app.secrets in all places
    - Remove references to `config.secret_token`, `config.secret_key_base`
- Warn that missing secret_key_base is deprecated
- Add tests for secret_token, key_generator, and message_verifier
  - the legacy key generator is used with the message verifier when
    secrets.secret_key_base is blank and secret_token is set
  - app.key_generator raises when neither secrets.secret_key_base nor
    secret_token are set
  - app.env_config    raises when neither secrets.secret_key_base nor
    secret_token are set
- Add changelog

Run focused tests via
ruby -w -Itest test/application/configuration_test.rb -n '/secret_|key_/'
2014-11-02 21:21:09 -06:00
yuuji.yaginuma
1b958e0a79 Revert "Replace String index juggling with Pathname goodness in db:fixtures:load"
This reverts commit 482fdad5ef8a73688b50bba3991dd4ef6f286edd.

Fixes #17237.
2014-11-02 23:58:30 +00:00
Godfrey Chan
4daebedcc4 Prepare for 4.2.0.beta4 release 2014-10-30 14:12:24 -07:00
Edwin Wills
c3857355b8 On larger screens the email preview iframe is being limited to a height of 800 pixels, and the full available screen size is not being used. 2014-10-29 18:24:05 +00:00
Santiago Pastorino
76bec5939c Merge pull request #17423 from lukefx/jruby_windows_tzinfo
Added 'tzinfo-data' if we are using jruby
2014-10-29 09:55:01 -02:00
Luca Simone
bf993fac57 Added 'tzinfo-data' if we are using jruby 2014-10-29 07:56:01 +01:00
Xavier Noria
e595d91ac2 edit pass over all warnings
This patch uniformizes warning messages. I used the most common style
already present in the code base:

* Capitalize the first word.

* End the message with a full stop.

* "Rails 5" instead of "Rails 5.0".

* Backticks for method names and inline code.

Also, converted a few long strings into the new heredoc convention.
2014-10-28 17:47:32 -07:00
Yves Senn
6c3bc96976 Merge pull request #17408 from bf4/fix_rbx_test
Fix rbx generated Gemfile regex
2014-10-28 09:29:28 +01:00
Andrew White
df0ea90cf1 Merge pull request #16229 from byroot/stop-swallowing-url-generation-errors
UrlGenerationError are not catched as 404 anymore
2014-10-27 22:46:19 +00:00
Benjamin Fleischer
a7fd386b63 Fix rbx generated Gemfile regex
https://travis-ci.org/rails/rails/jobs/39190983#L460

 1) Failure:
 AppGeneratorTest#test_psych_gem
 [test/generators/app_generator_test.rb:495]:
 Expected /gem 'psych',\s+'~> 2.0', \s+platforms: :rbx/ to match <snip>
 http://git.io/uuLVag)\ngem 'psych', '~> 2.0', platforms: :rbx\n\n
2014-10-27 16:03:53 -05:00
Jean Boussier
8e1362be3f UrlGenerationError are not catched as 404 anymore 2014-10-27 16:53:10 -04:00
Rafael Mendonça França
bf17c8a531 Add back --skip-turbolinks and remove --skip-gems
For the most part of cases --skip-gems option just remove one line in
the Gemfile. This is not worth for the complexity it adds.

Closes #17196
2014-10-26 20:47:47 -05:00
Godfrey Chan
9bbff50cc2 💅 it's -> its (see comments on 9a586ac) 2014-10-18 23:52:53 -07:00
Zachary Scott
9a586ac48d [ci skip] A Rails engine is not a man 🙆‍♀️ 2014-10-18 15:15:17 -07:00
Rafael Mendonça França
b9fcce3944 Merge pull request #17302 from claudiob/replace-slower-block-call-with-faster-yield
Replace (slower) block.call with (faster) yield
2014-10-18 17:08:24 -03:00
Zachary Scott
7b71d8cfab Revert "Replace (slower) block.call with (faster) yield"
This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
2014-10-18 13:04:02 -07:00
claudiob
0ab075e75f Replace (slower) block.call with (faster) yield
Performance optimization: `yield` with an implicit `block` is faster than `block.call`.
See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark:

```ruby
require 'benchmark/ips'

def fast
 yield
end

def slow(&block)
 block.call
end

Benchmark.ips do |x|
 x.report('fast') { fast{} }
 x.report('slow') { slow{} }
end

# => fast    154095 i/100ms
# => slow     71454 i/100ms
# =>
# => fast  7511067.8 (±5.0%) i/s -   37445085 in   4.999660s
# => slow  1227576.9 (±6.8%) i/s -    6145044 in   5.028356s
```
2014-10-18 12:59:51 -07:00
Rafael Mendonça França
07ae138386 Merge pull request #17292 from tricknotes/generator-test-doc
Fix example code for `Rails::Generators::Testing::Behaviour` [ci skip]
2014-10-16 17:04:01 -03:00
Ryunosuke SATO
101fbdba4c Fix example code for Rails::Generators::Testing::Behaviour [ci skip]
`cleanup_destination_root` method is not found anywhere.
Instead, `prepare_destination` clean up distination root on setup.
2014-10-17 04:57:36 +09:00
Rafael Mendonça França
be5521eb4e Use released rails-dom-testing 2014-10-16 16:53:46 -03:00
Yves Senn
ee787d9f58 test, Generators::GeneratedAttribute with references, required, index.
Closes #17197.
Closes #17207.

`{required}` is a type modifier so it should be:

    user:references{required}:index

and not:

    user:references:index{required}
2014-10-16 15:50:13 +02:00
Yves Senn
1a76ab8d42 Merge pull request #17278 from velobuff/clarify-debugger-invocation
clarify debugger platform invocation
2014-10-16 13:13:26 +02:00
Yves Senn
400b0818fa some changelog formatting. [ci skip] 2014-10-16 09:11:41 +02:00
Yves Senn
aaafbaf546 Merge pull request #17280 from aditya-kapoor/remove-unneeded-file
remove unneeded file from Railties.
2014-10-16 09:00:06 +02:00
Aditya Kapoor
f551a046df remove unneeded file 2014-10-16 12:05:01 +05:30
Aditya Kapoor
ce086b22e7 use require_command! instead of calling its definition 2014-10-16 11:05:58 +05:30
Raman Sinha
db41cc252c clarify debugger platform invocation 2014-10-15 19:04:02 -06:00
Rafael Mendonça França
733996cce1 Don't need to account turbolinks cookies in get request.
It was changed to not set the cookie in get requests at
62cc3db457.

Related with dcb05f26.
2014-10-13 17:24:44 -03:00
Rafael Mendonça França
f919d5f5ea Merge pull request #17240 from masarakki/fix-test_helper-of-mountable-plugin
fix test_helper for mountable plugin
2014-10-13 10:33:13 -03:00
masarakki
a441293cd9 fix test_helper for mountable plugin 2014-10-13 22:17:50 +09:00
Erik Michaels-Ober
8bb33e920a Replace Enumerable#reverse.each with Enumerable#reverse_each 2014-10-13 11:47:16 +01:00
Joshua Peek
fa5a1b9345 Default generated Gemfile to coffee-rails ~> 4.1.0 2014-10-12 18:27:27 -07:00
Rafael Mendonça França
7b740f31cc Merge pull request #17088 from robin850/jruby-dev
Follow up to #16613
2014-10-01 22:56:08 -03:00
Rafael Mendonça França
098158c38f Generate the application pointing to rails-dom-testing master
It is temporary until we do the final release
2014-09-30 13:42:55 -03:00
Abdelkader Boudih
175ca453a3 correct filename for jobs tests 2014-09-28 10:31:17 +00:00
Robin Dupret
1fac7b79f3 Follow up to #16613
Since we want this flag to be enabled anytime we are running the tests
under JRuby, let's enable this at the Rakefile level so people get the
performance boost on their local checkout.

Moreover, we avoid having to update this particular line anytime the
option changes on the JRuby side.

The only drawback is that we have to define it in every Rakefile but
there's no big deal, this is already the case for other options.
2014-09-28 12:04:06 +02:00
Jeremy Kemper
e1e8e532ac Merge pull request #17077 from schneems/schneems/backtrace-string-allocations
Decrease backtrace cleaner object allocations
2014-09-27 20:03:35 -07:00
Richard Schneeman
dfbcfafd9a Move object allocation out of loop
Right now BenchmarkCleaner allocates hundreds of strings on every request with an exception. This patch moves those strings to be generated at boot once and re-used.

## Bench Methods

I took a modified form of CodeTriage https://github.com/schneems/codetriage-ko1-test-app/blob/master/perf.rake and ran given rake tasks with and without the patch to BacktraceCleaner.

I made an endpoint results in exception

```
  def index
    raise “foo"
  end
```

The gem `memory_profiler` was used to capture objects allocated for a single request. Then `benchmark/ips` was used to test the speed of the patch.

You will see that we use less objects and the code becomes measurably faster with this patch.

## With patch:

Memory for one request:

```
Total allocated 7441
Total retained 37
```

Requests per second:


```
Calculating -------------------------------------
                 ips         4 i/100ms
-------------------------------------------------
                 ips       43.0 (±4.7%) i/s -        216 in   5.037733s
```


## Without patch:

Memory used for one request:


```
Total allocated 11599
Total retained 35 
```

Requests per second:

```
Calculating -------------------------------------
                 ips         3 i/100ms
-------------------------------------------------
                 ips       39.4 (±7.6%) i/s -        198 in   5.052783s
```

## Analysis

The patch is faster:

```
(43.0 - 39.4 ) / 39.4 * 100
# => 9 # % ~ speed bump
```

It also allocates less objects:

```
11599 - 7441
# => 4158
```

These strings are allocated on __EVERY SINGLE REQUEST__. This patch saves us 4158 objects __PER REQUEST__ with exception.

Faster errors == Faster applications
2014-09-27 13:42:20 +08:00
Rafael Mendonça França
4581d04477 Preparing for 4.2.0.beta2 release 2014-09-26 17:19:53 -03:00
Byron Bischoff
fe1b02d5ac remove extra # in css 2014-09-25 13:53:45 -07:00
Rafael Mendonça França
80990e2a0b rails-html-sanitizer is now the default
Also add to upgrading guide a notice about the deprecated sanitizers
2014-09-25 16:45:45 -03:00
Rafael Mendonça França
64fc8963b9 Remove unused code 2014-09-25 16:20:31 -03:00
Rafael Mendonça França
2922f63039 💅 the CSS 2014-09-25 16:09:43 -03:00
Rafael Mendonça França
89307fe2ce Merge pull request #17024 from buddhamagnet/amend-welcome-page
Amend welcome page
2014-09-25 16:07:19 -03:00
Godfrey Chan
b008e4bd8a Use released rails-html-sanitizer and rails-deprecated_sanitizer 2014-09-26 01:37:05 +09:00
buddhamagnet
be0206e4e2 Improve welcome page css and table cell aignments. 2014-09-25 11:59:13 -04:00
Rafael Mendonça França
478ad3f930 Use release web-console 2014-09-25 12:35:06 -03:00
Dan Olson
8e9bc11d22 Remove --skip-action-view option from application generator 2014-09-24 10:25:59 -05:00
Grzesiek Kolodziejczyk
95e3e42b87 Fix loading fixtures in engine tests
fixture_path is a class attribute of ActiveSupport::TestCase, so
ActiveSupport::TestCase.method_defined?(:fixture_path=) would always
return false.

This should fix #4971
2014-09-23 11:50:10 +02:00
Yuki Nishijima
f8e26c8014 Fix another false assertions
* The assertions in AS::Duration don't actually assert.
 * The assertion in Railtie will pass even when `eager_load_namespaces`
   doesn't include `AppTemplate::Application` if `Rails.application` is
   truthy.

For more details, see here:

 * https://github.com/rails/rails/pull/16998
 * https://github.com/rails/rails/pull/17000
2014-09-21 17:16:21 -07:00
Godfrey Chan
3e27a03fe4 Merge pull request #16984 from chancancode/fix_16578
Document that the default for `rails server -b` has changed
2014-09-22 01:08:19 +09:00
Godfrey Chan
5919cce0de Document that the default for rails server -b has changed
Fixes #16578
2014-09-22 01:04:42 +09:00
Tamir Duberstein
994d3ebe9b Standardize on Rails.application [ci skip]
This seems to be the style settled on in most of the templates.
2014-09-19 10:42:58 -07:00
Rafael Mendonça França
c2dfc31691 Merge pull request #16936 from untidy-hair/plugin_test_db_migrate_path
Specify dummy app's db migrate path in plugin's test_helper.rb

Conflicts:
	railties/CHANGELOG.md
2014-09-18 18:39:44 -03:00