Commit Graph

10365 Commits

Author SHA1 Message Date
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
Xavier Noria
112077c255 inject Rack::Lock if config.eager_load is false
If code is not eager loaded constants are loaded on demand. Constant
autoloading is not thread-safe, so if eager loading is not enabled
multi-threading should not be allowed.

This showed up in certain Capybara scenarios: Most Capybara drivers
other than Rack::Test need a web server. In particular, drivers for
JavaScript support. Capybara launches WEBrick in its own thread for
those but that per se is fine, because the spec thread and the server
thread are coordinated.

Problem comes if the page being served in the spec makes Ajax calls.
Those may hit WEBrick in parallel, and since WEBrick is multi-threaded
and allow_concurrency? returns true in the test environment before
this patch, threads are spawned to serve those parallel requests. On
the other hand, since eager_load is false by default in the test
environment, constants are not preloaded.

So the suite is autoloading constants in a multi-threaded set. That's
a receipt for paracetamol. The symptom is random obscure errors whose
messages point somehow to constant autoloading.

As a consequence of this fix for allow_concurrency? WEBrick in
Capybara scenarios no longer runs in multi-threaded mode.

Fixes #15089.
2014-09-18 23:04:08 +02:00
Yukio Mizuta
7137c6b775 Specify dummy app's db migrate path in plugin's test_helper.rb 2014-09-16 20:21:17 -07:00
Thibault Jouan
c9213e1033 Improve environment config templates consistency:
* Fix long lines;
* Use simple quotes for string literals when interpolation is not used.
2014-09-16 16:07:59 -03:00
Rafael Mendonça França
6e4aa9d5ea Merge pull request #16914 from untidy-hair/fix_plugin_dummy_path_error
Use dynamic path for dummy app location in plugin's test_helper.rb
2014-09-16 10:51:29 -03:00
yuuji.yaginuma
14f07fdc07 Add test:jobs task 2014-09-15 09:43:02 +09:00
Yukio Mizuta
8c9b347342 Use dynamic path for dummy app location in plugin's test_helper.rb 2014-09-14 10:55:19 -07:00
yuuji.yaginuma
b3c9d3e6fa Change ActiveJob test directory to "test/jobs" 2014-09-13 12:54:55 +09:00
Rafael Mendonça França
1245a9e06c Always define capture to remove the deprecation message 2014-09-11 00:55:05 -03:00
Rafael Mendonça França
53e877f7d9 Define the configuration at Active Support 2014-09-11 00:54:43 -03:00
Rafael Mendonça França
8edb5eeb36 Set test order in ActiveSupport::TestCase of isolation/abstract_unit 2014-09-10 22:42:15 -03:00
Rafael Mendonça França
e4c529ea1d Set the test order to be random in the generated app
This will avoid the warning in our tests. We delete all the
config/environments/ files in the test app so our default code will not
work.
2014-09-10 22:34:55 -03:00
Rafael Mendonça França
412f651665 Merge pull request #16839 from chancancode/default_test_order
Default to sorting user's test cases for now
2014-09-10 22:34:06 -03:00
Akira Matsuda
ed9d220cd1 Tell the user which file is missing when config/database.yml was not found
Since cc03675d30b58e28f585720dad14e947a57ff5b the error message became like
"Could not load database configuration. No such file -"
which doesn't really tell what's actually missing.
2014-09-10 19:25:01 +09:00
Sahil Lavingia
f234d1f07e Removed any default margin from body. 2014-09-09 13:38:53 -07:00
yuuji.yaginuma
ce39d735d0 Remove extra newline from ActiveJob test template 2014-09-09 16:37:28 +09:00
Godfrey Chan
2b41343c34 Default to sorting user's test cases for now
Goals:

1. Default to :random for newly generated applications
2. Default to :sorted for existing applications with a warning
3. Only show the warning once
4. Only show the warning if the app actually uses AS::TestCase

Fixes #16769
2014-09-08 05:32:16 -07:00
Godfrey Chan
381f9931ec Dependencies: bump to jquery-rails 4.0.0.beta2 2014-09-05 20:20:26 -07:00
Godfrey Chan
b1bc95bfa5 Use the released jquery-rails gem 2014-09-05 17:55:45 -07:00
Peter Schröder
d69e0ad39a world writable might be a bit too open... 2014-09-05 16:44:41 +02:00
Kale Worsley
39fc362b9b Change "For not..." to "Do not...". 2014-09-04 15:08:36 -06:00
Yves Senn
316962d092 build fix, we have to reset the RACK_ENV as well.
This is a follow-up to ded17a4 to get the build passing on Travis.
As Travis has `ENV["RACK_ENV"]` set to `test` we need to reset that as well.
2014-09-04 07:54:30 +02:00
Rafael Mendonça França
5db4e7f0ec Merge pull request #16775 from kaspth/ship-secure-sanitizer
Ship with rails-html-sanitizer instead.
2014-09-03 16:59:58 -03:00
Rafael Mendonça França
66c9d31c2b Merge pull request #16756 from huoxito/dont-mess-railties-default-order
Dont mess with default order engines load (4.1.6.rc1 regression)
2014-09-03 16:28:33 -03:00
Kasper Timm Hansen
28eecd934b Ship with rails-html-sanitizer instead. 2014-09-03 20:27:59 +02:00
Yves Senn
ded17a498a schema loading rake tasks maintain database connection for current env.
[Joshua Cody & Yves Senn]

Closes #16757.

Prior to this patch schema loading rake tasks had the potential to leak a
connection to a different database. This had side-effects when rake tasks
operating on the current connection (like `db:seed`) were chained.
2014-09-03 18:02:44 +02:00
Washington Luiz
435e8d719c Dont mess with default order engines load
When copying migrations some engines might depend on schema from other
engine so we can't blindly reverse all railties collection as that would
affect the order they were originally loaded. This patch helps to only
apply the order from engines specified in `railties_order`
2014-09-02 22:50:50 -03:00
Rafael Mendonça França
2e500e5c93 Merge pull request #16724 from seuros/testcase
[ActiveJob] TestCase
2014-09-02 11:31:08 -03:00
Matthew Draper
2f52f96988 Leave all our tests as order_dependent! for now
We're seeing too many failures to believe otherwise.

This reverts commits bc116a55ca3dd9f63a1f1ca7ade3623885adcc57,
cbde413df3839e06dd14e3c220e9800af91e83ab,
bf0a67931dd8e58f6f878b9510ae818ae1f29a3a, and
2440933fe2c27b27bcafcd9019717800db2641aa.
2014-09-02 23:55:34 +09:30
Abdelkader Boudih
fccf3d0b63 [ActiveJob] TestCase 2014-09-02 07:50:16 +00:00
Abdelkader Boudih
eb4245dd17 [ActiveJob] TestCase 2014-09-02 07:50:16 +00:00
Rafael Mendonça França
c6f9cec1be Add test to assert the right sanitizer vendor is being used 2014-09-01 22:46:05 -03:00
Rafael Mendonça França
2fc6d41670 Try with web-console master 2014-09-01 21:46:56 -03:00
Rafael Mendonça França
dd1fb2d769 Use jquery-rails master 2014-09-01 21:41:48 -03:00
Godfrey Chan
0db179a998 Keep it closer to the original wording [ci skip] 2014-08-31 12:23:05 -07:00
Rhett Sutphin
fc23ff64f8 Since /console is an optional feature, mention <%= console %> instead.
(/console is not mounted by default with web-console 2.0.)
2014-08-31 13:15:13 -05:00
David Heinemeier Hansson
7475b43cdb Merge branch 'master' of github.com:rails/rails 2014-08-29 14:54:08 -07:00
Akira Matsuda
4ded131181 Expectations first 2014-08-28 14:41:00 +09:00
Akira Matsuda
0c885d6818 Reset RACK_ENV after modified in a test case 2014-08-28 14:41:00 +09:00
Akira Matsuda
357edaaf83 Rails.root should be a Pathname 2014-08-28 14:41:00 +09:00
Guo Xiang Tan
a32298ffb3 Fix spelling. [CI SKIP] 2014-08-27 20:13:41 +08:00
Yves Senn
b9b521306c fix broken gem method with non-String arguments. Closes #16709.
This was caused by #15327.
2014-08-27 12:30:35 +02:00
yuuji.yaginuma
8a732e0474 show stats for app/jobs 2014-08-24 21:41:58 +09:00
Abdelkader Boudih
e63a02ccfb [ActiveJob] Add hook for test_framework and test templates 2014-08-22 20:06:22 +00:00
Matthew Draper
2602a49a86 Merge pull request #16622 from matthewd/default-debug
Don't fight against ourselves for the default log level
2014-08-23 00:28:32 +09:30
Jeremy Kemper
7fce216403 Merge pull request #16604 from saarons/clean-remote-ip-middleware
ActionDispatch::RemoteIp accept IPAddr matches for trusted proxies
2014-08-21 21:37:58 -07:00
Vijay Dev
0e4b217446 fix grammar [ci skip] 2014-08-22 09:45:16 +05:30
Vijay Dev
285a9f0dbe fix server names [ci skip]
Per feedback in af63e4a254 (commitcomment-7477636)
2014-08-22 09:43:45 +05:30
Sam Aarons
f9a84bb236 Refactor ActionDispatch::RemoteIp
Refactored IP address checking in ActionDispatch::RemoteIp to rely on
the IPAddr class instead of the unwieldly regular expression to match
IP addresses. This commit keeps the same api but allows users to pass
IPAddr objects to config.action_dispatch.trusted_proxies in addition
to passing strings and regular expressions.

Example:

    # config/environments/production.rb
    config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.0/16')
2014-08-21 18:38:08 -07:00
Matthew Draper
523e279792 Don't fight against ourselves for the default log level
If we want to always default to :debug, let's just do that.

At which point the production.rb entry can become an "uncomment to
change" instead.
2014-08-22 05:47:30 +09:30
Vijay Dev
af63e4a254 Make text consistent in help text of rails server and console commands. 2014-08-21 16:22:55 +00:00
Rafael Mendonça França
212fde6a1a Remove timestamp type from generator usage
It was soft removed at 03035d69e14032a589e9653e3145237b8a9a09be
2014-08-20 16:50:06 -03:00
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
Nick Sinenko
31c98ecc1d remove end-of-line spacing in development.rb, production.rb 2014-08-20 19:21:58 +10:00
David Heinemeier Hansson
6a23bf0f4c Preparing for 4.2.0.beta1 release 2014-08-19 19:32:51 -07:00
Carlos Antonio da Silva
e43271444b Fix failing railties tests
A combination of two commits led into these failures:

* The addition of a new active_record config in
  24bb8347b6ff0da90059314d9aece7a2c94a272c
* The revert of the config to use config.x as options holder in
  43073b393d234acd094ac7c220163f4e419d11f5

These tests remove activerecord from the load path, however the
configuration is still in the application file, and they blow up.
2014-08-19 22:37:18 -03:00
Carlos Antonio da Silva
6e420aa99c Fix blank link on config/application.rb app template [ci skip] 2014-08-19 22:21:57 -03:00
Carlos Antonio da Silva
2f7ac9cdcc Fix setting simple values to the new config.x
Previously setting simple values to the config.x object resulted in the
following:

    config.x.super_debugger = true
    config.x.super_debugger #=> {}

Which was against the examples showed in the changelog/release notes.
2014-08-19 21:59:01 -03:00
Rafael Mendonça França
e2066818e8 Point to right sass-rails version 2014-08-19 21:58:05 -03:00
Guillermo Iguaran
35b2d3f56c Use web-console 2.0.0.beta2 on new apps 2014-08-19 19:39:29 -05:00
Rafael Mendonça França
43073b393d Revert "Improve custom configuration"
This reverts commit de4891344ccc074f6d5693f4fac6ad610584e336.

Conflicts:
	railties/lib/rails/railtie/configuration.rb

It added regression. Will be back after the beta
2014-08-19 19:41:15 -03:00
Guillermo Iguaran
b9700c1e51 Merge pull request #16561 from gsamokovarov/mention-web-console-in-changelog
Mention web-console in 4.2 release notes
2014-08-19 16:20:53 -05:00
Genadi Samokovarov
5407084cc5 Mention web-console in 4.2 release notes
Mention the web-console inclusion in the default Gemfile in the Release
notes and the railties changelog. We can eventually mention it in the
upgrade guide, if needed.

[ci skip]
2014-08-20 00:01:10 +03:00
Rafael Mendonça França
299c264552 We always get the value so no need to check nil or Hash 2014-08-19 17:38:29 -03:00
Rafael Mendonça França
091645116b Use released rails-html-sanitizer 2014-08-19 16:47:26 -03:00
Rafael Mendonça França
24bb8347b6 Merge pull request #16563 from arthurnn/add_ar_raise_trans_option
Add default .raise_in_transactional_callbacks option to template
2014-08-19 16:19:36 -03:00
Rafael Mendonça França
b8ef1d8abd loofah require dependecy is not needed anymore 2014-08-19 16:15:41 -03:00
Arthur Neves
c7c2df2c63
Add default .raise_in_transactional_callbacks option to template 2014-08-19 13:56:55 -04:00
Rafael Mendonça França
de4891344c Improve custom configuration
1. Hashes can be assigned
2. We don't need a special level anymore

The method chain only works in the top level.

If users need a second level they need to assign a OrderedOptions to the
key:

    config.resque.server = ActiveSupport::OrderedOptions.new
    config.resque.server.url = "http://localhost"
    config.resque.server.port = 3000

[Rafael Mendonça França + Carlos Antonio da Silva]
2014-08-19 13:59:22 -03:00
Rafael Mendonça França
ec7a8b0649 Rack is released too 2014-08-18 16:14:01 -03:00
Rafael Mendonça França
8292cdb50e No need to point to arel and i18n master anymore 2014-08-18 15:59:03 -03:00
Jon Atack
ff39a975a7 Fix rails-html_sanitizer in Gemfile template
[skip ci]
2014-08-18 11:03:37 +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
Rafael Mendonça França
c78da4d5c4 Merge branch 'master' into loofah
Conflicts:
	actionpack/CHANGELOG.md
2014-08-17 22:38:22 -03:00
Rafael Mendonça França
4e49134621 Use the release gems and point application gemfile to right loofah 2014-08-17 22:34:44 -03:00
David Heinemeier Hansson
7ee055076e Merge pull request #16481 from sgrif/sg-change-default-timestamps
Change the default `null` value for timestamps
2014-08-17 18:12:52 -07:00
Rafael Mendonça França
eced6f8118 Merge pull request #16294 from bf4/code_tools
Update, unify, encapsulate, and fix various code tools in Rails
2014-08-17 22:12:23 -03:00
David Heinemeier Hansson
5d2de5c3b8 Merge branch 'master' of github.com:rails/rails 2014-08-17 16:54:26 -07:00
David Heinemeier Hansson
49c9f850fa Merge pull request #16485 from seuros/activejob
Integrate ActiveJob / DeliverLater / GlobalID with Rails
2014-08-17 16:44:30 -07:00
David Heinemeier Hansson
c20c86ee9e Dont encourage people to run without autoflush in production 2014-08-17 16:40:41 -07:00
Genadi Samokovarov
07ca1d3ab6 Lock web-console to 2.0.0.beta1 for the first 4.2 beta
The console on exception code isn't available on the stable releases
yet. Lock it for now, so the beta users get a sneak peak of the console
features.
2014-08-18 02:03:58 +03:00
Godfrey Chan
beff925c32 Merge pull request #16467 from strzalek/cookies-digest-config-option2
Cookies digest config option (pt. 2)

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_dispatch/middleware/cookies.rb
2014-08-17 11:23:14 -07:00
Kasper Timm Hansen
1e2ffe7ae6 Prepare for partial release.
- Default to Rails::DeprecatedSanitizer in ActionView::Helpers::SanitizeHelper.
- Add upgrade notes.
- Add sanitizer to new applications Gemfiles.
- Remove 'rails-dom-testing' as a dependency.
2014-08-17 19:25:47 +02:00
Cristian Bica
b2cabb7ace Added docs for AJ::Callbacks; Added AJ to docs build map 2014-08-16 01:31:39 +03:00
Akira Matsuda
2cc1a64579 s/Dont'/Don't/ 2014-08-15 13:59:05 +09:00
Cristian Bica
06908e60be Merge branch 'master' into activejob 2014-08-13 22:55:32 +03:00
Akira Matsuda
bf0a67931d Railties tests are order_independent! Hopefully. 2014-08-13 21:25:11 +09:00
Akira Matsuda
655c2c8b50 Fix Railties tests that were order dependent 2014-08-13 21:25:11 +09: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
Łukasz Strzałkowski
29be3f5d83 Add config option for cookies digest
You can now configure custom digest for cookies in the same way as `serializer`:

  config.action_dispatch.cookies_digest = 'SHA256'
2014-08-12 21:57:51 +02:00
Rafael Mendonça França
e81f3c210e Nobody sucks so nobody should call this awful method name 2014-08-12 10:51:41 -03:00
Akira Matsuda
6ffb29d24e users_dont_suck_but_only_we_suck_and_only_our_tests_are_order_dependent!
Calling ActiveSupport::TestCase.i_suck_and_my_tests_are_order_dependent! in AS::TestCase makes
everyone's tests order dependent, which should never be done by the framework.
2014-08-12 19:37:04 +09:00
Abdelkader Boudih
0c232779ec Remove activejob integration tests 2014-08-12 10:07:21 +00:00
Santiago Pastorino
d70ba48c4d Revert "Merge pull request #16434 from strzalek/cookies-digest-config-option"
This reverts commit 705977620539e2be6548027042f33175ebdc2505, reversing
changes made to dde91e9bf5ab246f0f684b40288b272f4ba9a699.

IT BROKE THE BUILD!!!
2014-08-08 18:20:33 -03:00
Santiago Pastorino
7059776205 Merge pull request #16434 from strzalek/cookies-digest-config-option
Add digest config option for SignedCookiesJar
2014-08-08 18:05:53 -03:00
Łukasz Strzałkowski
629f4e007c Return preconfigured AS::MessageVerifier 2014-08-08 21:24:02 +02:00
Łukasz Strzałkowski
cfbedd3479 Add config option for cookies digest
You can now configure custom digest for cookies in the same way as `serializer`:

config.action_dispatch.cookies_digest = \SHA256'
2014-08-08 21:20:27 +02:00
Aaron Patterson
dde91e9bf5 save a hash allocation per request. 2014-08-08 11:41:54 -07:00
Aaron Patterson
5b27f1ea18 add a test for prepending SCRIPT_NAME to generated urls 2014-08-08 11:41:21 -07: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
David Heinemeier Hansson
fbe38c9e9d Pull spring gem entry into the Gemfile template instead of gemfile_entries so it can be grouped with the other development tools 2014-08-07 16:34:27 -07:00
David Heinemeier Hansson
089661b69a Merge branch 'master' of github.com:rails/rails 2014-08-07 16:10:20 -07:00
David Heinemeier Hansson
cc1de71bfa Stop using padding in the generated Gemfile -- it looks shit 2014-08-07 16:10:14 -07:00
Aaron Patterson
e81453ef92 need to call super 2014-08-07 16:03:09 -07:00
Aaron Patterson
8121eefc22 add a new constructor that runs load hooks 2014-08-07 15:50:46 -07:00
Aaron Patterson
2296989826 defer running after_config hooks until after the object is allocated 2014-08-07 15:28:53 -07:00
Aaron Patterson
d25fe31c40 lazily instantiate application subclasses
this means we can meaningfully override methods in the subclass
2014-08-06 18:27:16 -07: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
Yves Senn
53dba73dc1 Revert "Revert "Merge pull request #15394 from morgoth/fix-automatic-maintaining-test-schema-for-sql-format""
This reverts commit 5c87b5c5248154cf8aa76cce9a24a88769de022d.
2014-08-06 08:25:18 +02:00
Guillermo Iguaran
ab54ec7248 We don't need parenthesis for this 2014-08-05 11:51:12 -05:00
Arthur Neves
a7060a6e21
Fix digest ETAG test.
After
12528d4567
ETag will include a `W/` before the digest.
2014-08-05 12:40:54 -04: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
Jon Atack
9794e74977 Fix typo [ci skip] 2014-08-04 19:19:26 +02:00
David Heinemeier Hansson
3d70f0740b Explain why we use asset digests, not what a setter does 2014-08-03 16:02:32 -07:00
David Heinemeier Hansson
5132f8383c Add suggestion as to how you can app the the assets load path 2014-08-03 15:55:22 -07:00
David Heinemeier Hansson
611849772d Pull in the custom configuration concept from dhh/custom_configuration 2014-08-03 15:48:14 -07: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
58ce115fa5 Change the production log level default from :info to :debug. All production apps I have ever worked with has done this. Let us reflect that default. You often want those SQL quieries to be able to debug issues in production 2014-08-03 14:57:43 -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
Carlos Antonio da Silva
5d4fce640e Remove some more globals from tests
We are using blocks here so we have access to the environment around
them, no need for globals.
2014-07-30 22:52:38 -03:00
Carlos Antonio da Silva
32f49612e7 Fix / improve some assertions 2014-07-30 22:52:38 -03:00
Carlos Antonio da Silva
5fc5665066 Remove some globals from configuration tests 2014-07-30 22:52:38 -03:00
@schneems and @sgrif
2bbcca004c Deprecate *_path methods in mailers
Email does not support relative links since there is no implicit host. Therefore all links inside of emails must be fully qualified URLs. All path helpers are now deprecated. When removed, the error will give early indication to developers to use `*_url` methods instead.

Currently if a developer uses a `*_path` helper, their tests and `mail_view` will not catch the mistake. The only way to see the error is by sending emails in production. Preventing sending out emails with non-working path's is the desired end goal of this PR.

Currently path helpers are mixed-in to controllers (the ActionMailer::Base acts as a controller). All `*_url` and `*_path` helpers are made available through the same module. This PR separates this behavior into two modules so we can extend the `*_path` methods to add a Deprecation to them. Once deprecated we can use this same area to raise a NoMethodError and add an informative message directing the developer to use `*_url` instead.

The module with warnings is only mixed in when a controller returns false from the newly added `supports_relative_path?`.

Paired @sgrif & @schneems
2014-07-30 12:01:45 -05: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
Yves Senn
94abb92c8d Merge pull request #16328 from noinkling/template_password_confirmation_fix
Give password_confirmation div the "field" class in the scaffold generator "_form" partial
2014-07-29 12:22:22 +02:00
noinkling
ed29c0a96b Give password_confirmation div the "field" class in erb form template 2014-07-29 16:16:31 +12:00
tanraya
6bd812605d Use local variables in _form.html.erb generated by scaffold generator.
It seems a good idea to use local variables in generated partials instead of using instance variables.

Before

    <%= render 'form' %>

After

    <%= render 'form', product: @product %>
2014-07-26 09:40:24 +06:00
Benjamin Fleischer
780fd61c24 Remove unused, broken, legacy ruby-prof extension from 2005
[ci skip]
2014-07-25 13:25:37 -05:00
noinkling
31d37826b3 Additional clarification on password:digest in scaffold and model generator help [ci skip] 2014-07-25 18:29:58 +12:00
noinkling
2a7fcc8c9b Add password:digest information to scaffold generator help text [ci skip] 2014-07-25 16:42:01 +12:00
Rafael Mendonça França
b17330cf39 Remove mocha usage 2014-07-23 19:01:44 -03:00
Rafael Mendonça França
23cb26cfac Fix syntax error 2014-07-23 18:30:27 -03:00
Rafael Mendonça França
ecef1776a0 Dev and edge application and plugins need to include i18n master 2014-07-23 18:05:57 -03:00
Rafael Mendonça França
bec08e7744 Merge pull request #16267 from robin850/rbx-yaml
Set Psych as the YAML engine for Rubinius
2014-07-23 17:45:15 -03:00
Rafael Mendonça França
cd7d414e48 Do not set enforce_available_locales to i18n 0.7
Now the default is always true.

Users still can set it using config.i18n.enforce_available_locales.
2014-07-23 17:40:44 -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
533c035205 Merge pull request #16212 from aantix/additional_migration_conflict_help_messaging
Additional help messaging to help the user resolve a conflicted migration
2014-07-18 18:22:37 -03:00
Jim Jones
cc1ad787af Modified migration conflict message to remove the string concatenation. 2014-07-18 08:51:36 -07:00
Guo Xiang Tan
ee35b79d4c Prefer to pass block when logging.
The Logger by default includes a guard which checks for the
logging level. By removing the custom logging guards, we can decouple
the logging guard from the logging action to be done.

This also follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance.
2014-07-18 15:04:43 +08:00
Jim Jones
af3cf61aa7 Added additional help messaging when there's scaffolding being generated and a migration already exists for the resource.
The user is now alerted that they are able to skip the conflicted migration file via the --skip option.
2014-07-17 21:19:07 -07:00
Rafael Mendonça França
fcc2231a04 Stop using mocha on dbconsole_test 2014-07-15 23:36:45 -03:00
Rafael Mendonça França
3121412cf1 Keep quietly and capture undeprecated on your suite 2014-07-15 17:56:27 -03:00
Rafael Mendonça França
9629dea4fb Add Rails::Application#config_for
This is a convenience for loading configuration for the current Rails
environment.
2014-07-15 15:35:13 -03:00
Andrey Chernih
b3a34cd374 Add ability to extend rails server command options parser
With this change it will be possible to add additional options to the `option_parser` like this:

    require 'rails/commands/server'
    module Rails
      class Server < ::Rack::Server
        class Options
          def option_parser_with_open(options)
            parser = option_parser_without_open options
            parser.on('-o', '--open', 'Open in default browser') { options[:open] = true }
            parser
          end
          alias_method_chain :option_parser, :open
        end

        def start_with_open
          start_without_open do
            `open http://localhost:3000` if options[:open]
          end
        end
        alias_method_chain :start, :open
      end
    end
2014-07-11 23:26:33 +04:00
Santiago Pastorino
6e23c8242d Merge pull request #16132 from tgxworld/fix_test_not_unsubscribing
Fix incorrect unsubscription.
2014-07-11 08:14:55 -03:00
Godfrey Chan
00aae7cb38 Synced 4.2 release notes with the latest commits.
Also reordered some of the items to put newer ones on top (same order as
CHANGELOGs), which makes it easier to diff while we are still working on it.
2014-07-11 02:16:57 -07:00
Guo Xiang Tan
d9396a07eb Fix incorrect unsubscription. 2014-07-11 16:38:26 +08:00
Aaron Patterson
97d62a32f8 Merge pull request #13999 from jamox/update_rack
This updates rails to use edge rack
2014-07-08 11:46:56 -07:00
Rafael Mendonça França
a83efa4a1f Stop using mocha on console_test 2014-07-07 23:39:18 -03:00
Rafael Mendonça França
57e298fcd5 Set the application logger using configuration 2014-07-07 22:57:55 -03:00
Rafael Mendonça França
d3af622586 Stop using mocha on configuration_test 2014-07-07 22:46:39 -03:00
Rafael Mendonça França
fb9eb7019e Stop using mocha on app_rails_loader_test 2014-07-07 22:05:30 -03:00
Zachary Scott
2f716694f2 Change back occurrences of SQLite(3) to sqlite3 when referring to the
adapter, fixed from #16057 [ci skip]
2014-07-06 11:47:16 -07:00
Zachary Scott
2cda0aff30 Merge pull request #16057 from akshay-vishnoi/doc_change
[ci skip] /sqlite/i --> SQLite
2014-07-06 11:41:31 -07:00
Akshay Vishnoi
ddad32978d [ci skip] /sqlite/i --> SQLite 2014-07-06 15:23:12 +05:30
Rafael Mendonça França
871af9122b Merge pull request #16046 from grosser/grosser/cleangen
Do not load rails without loading bundler
2014-07-04 12:35:46 -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
grosser
8572fcd9f8 remove bundler magic 2014-07-03 17:28:55 -07:00
Rafael Mendonça França
5c87b5c524 Revert "Merge pull request #15394 from morgoth/fix-automatic-maintaining-test-schema-for-sql-format"
This reverts commit 46139d33c06715e74ad450428ece3ee84da98579, reversing
changes made to 8f247871bb18b2e3036a05df5f62cbfe3b402586.

Conflicts:
	activerecord/CHANGELOG.md
2014-07-02 09:41:52 -03:00
Rafael Mendonça França
72f58b0244 Rename preview_enabled option to show_previews 2014-07-01 13:09:24 -03:00
Leonard Garvey
84ed7b8dfe Add configuration to enable mail previews
Adds `config.action_mailer.preview_enabled`

This allows mail previewing to be enabled easily in non-development
environments such as staging. The default is set to true for development
so no changes should be required to existing Rails applications.

The mail preview path can still be configured using the existing
`config.action_mailer.preview_path` configuration option.

Adding this avoids devs from having to do stuff like:
https://gist.github.com/lengarvey/fa2c9bd6cdbeba96526a

Update actionmailer/CHANGELOG with new configuration.
Update configuring guide with new configuratation.
Add `config.action_mailer.preview_path` to configuring guide.
2014-07-01 14:39:59 +10:00
Rafael Mendonça França
ebdedaec32 Merge pull request #15933 from rafael/master
Add always permitted parameters as a configurable option.

[Rafael Mendonça França + Gary S. Weaver]
2014-06-27 18:16:52 -03:00
Rafael Chacón
58399e1dc3 Improvements per code review.
* General style fixes.
* Add changes to configuration guide.
* Add missing tests.
2014-06-27 13:08:40 -07:00
Rafael Mendonça França
30b56084fb Talk about config.assts.version move too
Closes #15942
2014-06-27 16:00:00 -03:00
Viktar Basharymau
0813607c70 Add a test for db:migrate:status to check missing file scenario 2014-06-27 18:28:12 +03:00
Rafael Chacón
c197a7dc41 Add always_permitted_parameters as an option.
* This commit adds back the always_permitted_parameters
  configuration option to strong paramaters.
* The initial pull requests where this feature was added
  are the following:
  - https://github.com/rails/rails/pull/12682
  - https://github.com/rails/strong_parameters/pull/174
2014-06-26 23:01:30 -07:00
Rafael Mendonça França
d625af297a Require shellwords since it is dependecy of this file
Closes #15919
2014-06-26 06:55:18 -03:00
Rafael Mendonça França
5ee87777af Merge pull request #15885 from lucasmazza/lm-skip-routes
Add a '--skip-routes' flag for the Controller generator.
2014-06-24 14:12:44 -03: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
Yves Senn
9ac1ce11ad :nodoc: all does not remove the constants from the API. [ci skip]
Need to add individual `:nodoc:` for nested classes / modules to completely
remove the constants from the API.
2014-06-24 14:16:29 +02:00
Amit Suryavanshi
de7c61b072 Titling the model name in views generated by scaffold.
eg. rails g scaffold UserProfile will have in index.html.erb "Listing User Profiles"
rather than Listing user_profiles.
2014-06-18 11:32:02 +05:30
Rafael Mendonça França
84a13e019e Deprecate Rails::Rack::LogTailer
It was being used by Rails for show the development logs but since Rails
4 it is not being used anymore on the framework.

This class seems to be private but it were part of the public API we are
deprecating before removing.
2014-06-17 22:48:28 -03:00
Rafael Mendonça França
7f7e2f12ab initialize the right variable 2014-06-17 20:39:49 -03:00
Rafael Mendonça França
8de4d61dc2 ✂️ 2014-06-17 20:35:10 -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
Rafael Mendonça França
0724706b6d Merge pull request #15716 from schuetzm/skip-turbolinks
Add an option to skip installation of Turbolinks
2014-06-17 19:47:25 -03:00
Yves Senn
f59ed560ac allow preview interceptors to be registered through config.action_mailer.
This was partially broken because `preview_interceptors=` just assigned the
raw values, whithout going through `register_preview_interceptor`. Now the
Action Mailer railtie takes care of the `preview_interceptors` option.

This commit is a partial revert of:

Revert "Merge pull request #15739 from y-yagi/correct_doc_for_action_mailer_base"

This reverts commit a15704d7f35f17d34d0118546799141d6f853656, reversing
changes made to 1bd12a8609d275ad75fcc4b622ca4f5b32dc76be.

/cc @kuldeepaggarwal @y-yagi
2014-06-15 14:17:00 +02:00
Aditya Kapoor
1505f8b692 [ci-skip] correct wikipedia MVC link 2014-06-14 23:34:08 +05:30
Marc Schütz
e3dca3acc6 Add an option to skip installation of Turbolinks 2014-06-14 12:03:09 +02:00
Yves Senn
46139d33c0 Merge pull request #15394 from morgoth/fix-automatic-maintaining-test-schema-for-sql-format
ActiveRecord::Migration.maintain_test_schema! doesn't work with structure.sql

Conflicts:
	activerecord/CHANGELOG.md
2014-06-12 15:29:20 +02:00
Wojciech Wnętrzak
ad42aaed04 Fixed automatic maintaining test schema to properly handle sql structure schema format.
Additionally:
* It changes `purge` task on `sqlite3` adapter to recreate database file, to
be consistent with other adapters.
* Adds `purge` step when loading from `schema.rb`
2014-06-12 13:08:56 +02:00
Fabian Rodriguez
f374720402 remove unnused method from test 2014-06-11 20:26:47 -03:00
Akshay Vishnoi
b6760d8f14 [ci skip] Fix capitalization 2014-06-07 14:23:27 +05:30
Gaurav Sharma
19ef270923 remove rubyforge.org that was shut down [ci skip] 2014-06-06 22:26:56 +05:30
schneems
72f45ba292 Emit suggested generator names when not found
When someone types in a generator command it currently outputs all generators. Instead we can attempt to find a subtle mis-spelling by running all generator names through a levenshtein_distance algorithm provided by rubygems. 

So now a failure looks like this:

```ruby
$ rails generate migratioooons
Could not find generator 'migratioooons'. Maybe you meant 'migration' or 'integration_test' or 'generator'
Run `rails generate --help` for more options.
```

If the suggestions are bad we leave the user with the hint to run `rails generate --help` to see all commands.
2014-06-04 16:28:43 -05:00
David Jones
1da201b4db File.exist? instead of File.exists? in bin/setup
File.exists? is deprecated in Ruby 2.1+

https://github.com/ruby/ruby/blob/v2_1_2/file.c#L1413
2014-06-02 15:31:09 -04:00
Zachary Scott
4c66ab2b21 Feature requests should be made on the mailing list, not submitted to
the issue tracker. See also #15455 [ci skip]
2014-06-01 19:11:39 -07: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
Wojciech Wnętrzak
df6dc1b51a Added missing test case for migrations when using sql structure 2014-06-01 17:30:05 +02:00
Vijay Dev
4ae90a7dd8 Merge branch 'master' of github.com:rails/docrails 2014-06-01 11:46:37 +00:00
Yves Senn
41f4cc0bc6 bin/setup uses bundle check || bundle install to improve performance. 2014-05-30 15:23:26 +02:00