Commit Graph

55727 Commits

Author SHA1 Message Date
Hayley Anderson
04d4928e60 Improve Action Cable configuration explanations
* Clarify wording around how defaults work
* Clarify wording around what formatting versus information is required
* Separate consumer configuration section since it is important and wordy
* Add additional explanation of options for setting consumer configuration
* Consolidate consumer configuration information to reduce confusion
2016-01-18 00:22:00 -05:00
Aaron Patterson
7b7b12f598 do not run in parallel on travis 2016-01-12 15:55:47 -08:00
Sean Griffin
b64b754510 Revert "Change WhereClause#merge to same named columns on diff tables"
This reverts commit 5d41cb3bfd6b19833261622ce5d339b1e580bd8b.

This implementation does not properly handle cases involving predicates
which are not associated with a bind param. I have the fix in mind, but
don't have time to implement just yet. It will be more similar to #22823
than not.
2016-01-12 15:48:00 -07:00
Aaron Patterson
dd73144658 remove present? calls
Empty strings / data structures should be treated differently than nils.
We don't really need these calls here (don't pass in blank strings).
2016-01-12 14:22:02 -08:00
Aaron Patterson
04d61612f9 monkey patch recycle! on to controllers once
Instead of checking whether the class has recycle! or not, we can just
always add the method to all controller classes when the test harness is
loaded.  Technically this means that the controller test harness will
not work with controllers that do not inherit from AC::Metal, but then,
I'm not sure that is supported anyway.

Mixing in the module one will ensure that we don't break method caches,
and eliminates a runtime check so it should speed up tests (slightly).
2016-01-12 14:09:56 -08:00
Rafael França
12f4976200 Merge pull request #22935 from cllns/add-status-name-to-output
Add HTTP status name to output of tests
2016-01-12 19:47:40 -02:00
Rafael França
89f70938d7 Merge pull request #23035 from jkowens/fix-null-byte
Prevent static middleware from attempting to serve a request with a null byte
2016-01-12 19:46:42 -02:00
Sean Griffin
5d41cb3bfd Change WhereClause#merge to same named columns on diff tables
While the predicates are an arel equality node where the left side is a
full arel attribute, the binds just have the name of the column and
nothing else. This means that while splitting the predicates can include
the table as a factor, the binds cannot. It's entirely possible that we
might be able to have the bind params carry a bit more information (I
don't believe the name is used for anything but logging), and that is
probably a worthwhile change to make in the future.

However the simplest (and likely slightly faster) solution is to simply
use the indices of the conflicts in both cases. This means that we only
have to compute the collision space once, instead of twice even though
we're doing an additional array iteration. Regardless, this method isn't
a performance hotspot.

Close #22823.

[Ben Woosley & Sean Griffin]
2016-01-12 14:38:25 -07:00
Sean Collins
a4032ca072 Add both HTTP Response Code and Type to assertion messages
Also, refactor logic to convert between symbol and response code,
via the AssertionResponse class
2016-01-12 13:09:00 -07:00
Rafael França
858b9652ce Merge pull request #23034 from claudiob/fix-ac-param-as-json
AC::Parameters#at_json: restore Rails 4.2’s value
2016-01-12 17:38:22 -02:00
Jordan Owens
918f0eea97 Prevent attempt to serve a request with a null byte
File paths cannot contain null byte characters and methods that do path
operations such as Rack::Utils#clean_path_info will raise unwanted
errors.
2016-01-12 14:05:54 -05:00
claudiob
2228860364 AC::Parameters#at_json: restore Rails 4.2’s value
Fixes #23026

See discussion at #23026
2016-01-12 10:27:29 -08:00
Yves Senn
64448c29de bring back TEST env for rake test.
Closes #23027.

This does not restore complete backwards compatibility. It simply passes
the contets of the `TEST` env to the new runner.
2016-01-12 19:26:05 +01:00
Yves Senn
f718e52bcc add migration versioning example to the changelog. [ci skip]
Closes #23021.
2016-01-12 09:08:18 +01:00
Matthew Draper
d16645a37a Merge pull request #23004 from matthewd/default-scope-sti
Make default scopes + STI happy again
2016-01-12 13:59:46 +10:30
Matthew Draper
5eef308561 Merge pull request #23020 from matthewd/frozen-headers
Commit before freezing the headers
2016-01-12 12:25:05 +10:30
Matthew Draper
272c5838df Commit before freezing the headers
This shouldn't generally come up: under a standard flow, we don't start
sending until after the commit. But application code always finds a way.
2016-01-12 11:37:42 +10:30
Jon Moss
ddfd51f270 Merge pull request #20762 from maurogeorge/record-not-found-doc
Add a note on ActionController guide about 404
2016-01-11 16:40:08 -05:00
Mauro George
43800057fc Add a note on ActionController guide about 404
[ci skip]
2016-01-11 19:27:19 -02:00
Akira Matsuda
dbf67b3a6f Unneeded &block parameters 2016-01-12 05:15:56 +09:00
Richard Schneeman
83215b86fe Merge pull request #23015 from schneems/schneems/manual-environment-set
Allow manually setting environment value
2016-01-11 13:57:53 -06:00
Matthew Draper
5c6d365383 Skip the STI condition when evaluating a default scope
Given a default_scope on a parent of the current class, where that
parent is not the base class, the parent's STI condition would become
attached to the evaluated default scope, and then override the child's
own STI condition.

Instead, we can treat the STI condition as though it is a default scope,
and skip it in this situation: the scope will be merged into the base
relation, which already contains the correct STI condition.

Fixes #22426.
2016-01-12 05:43:58 +10:30
Matthew Draper
8ce0175d50 Active scopes apply to child classes, though not parents/siblings
While the commit message (and changelog example) in
5e0b555b453ea2ca36986c111512627d806101e7 talked about sibling classes,
the added test had a child ignore its parent's scoping, which seems less
reasonable.
2016-01-12 05:43:58 +10:30
schneems
eafa43e870 Allow manually setting environment value
If for some reason some one is not able to set the environment from a migration this gives us an escape valve to manually set the environment for the database see https://github.com/rails/rails/pull/22967#issuecomment-170251635.

We will also fix the migration case, but this will ensure there is always a way to set the environment.

cc/ @sgrif
2016-01-11 11:00:34 -06:00
Kasper Timm Hansen
179df9df68 Merge pull request #23003 from y-yagi/remove_warnings
remove warnings from rake test
2016-01-11 09:07:52 +01:00
Kasper Timm Hansen
72c801476b Merge pull request #22808 from y-yagi/do_not_clear_all_reporters
delete only unnecessary reporter
2016-01-11 09:07:05 +01:00
yuuji.yaginuma
d82bf14003 delete only unnecessary reporter
Reporter that defines its own users at the time of this process are also loaded,
to avoid them from being deleted, to delete only the specified to unnecessary reporter.
2016-01-11 12:36:09 +09:00
yuuji.yaginuma
a2338c5833 remove warnings from rake test
This removes the following warnings.

```
test/application/rake_test.rb:33: warning: ambiguous first argument; put parentheses or a space even after `/' operator
test/application/rake_test.rb:43: warning: ambiguous first argument; put parentheses or a space even after `/' operator
```
2016-01-11 12:33:23 +09:00
Sean Griffin
5465224892 Merge pull request #22998 from kamipo/extract_mysql_column_class
Extract `MySQL::{Column|TypeMetadata}` classes to the appropriate files
2016-01-10 19:03:07 -07:00
Kasper Timm Hansen
0cffe1b316 Merge pull request #20638 from jaimeiniesta/locale-aware-pluralize-helper
Pass the current locale to Inflector from the pluralize text helper.
2016-01-10 21:42:03 +01:00
Ryuta Kamizono
560bf1c939 Extract MySQL::TypeMetadata class to connection_adapters/mysql/type_metadata.rb 2016-01-11 05:03:31 +09:00
Ryuta Kamizono
83026cb15d Extract MySQL::Column class to connection_adapters/mysql/column.rb 2016-01-11 04:54:03 +09:00
Jaime Iniesta
82aab15dac Pass the current locale to Inflector from the pluralize text helper.
The pluralize text helper uses the Inflector to determine the plural
form. The inflector accepts an optional parameter for the locale,
so we can pass it from the text helper to have locale-aware pluralizations
on the text helpers level.

The pluralize text helper now only accepts 2 positional arguments:
`count` and `singular`. Passing `plural` as a positional argument
is now deprecated.
2016-01-10 20:47:41 +01:00
Kasper Timm Hansen
efa445c7b5 Merge pull request #22833 from sivagollapalli/test_runner_with_multiple_lines
Running tests with multiple line numbers
2016-01-10 18:25:54 +01:00
Siva Gollapalli
78b5a01252 Added multiple line filters support for test runner 2016-01-10 22:37:01 +05:30
Kasper Timm Hansen
56c93bba2f Merge pull request #21181 from denisenkom/mypatch
Test basic auth with symbols in password
2016-01-10 17:44:43 +01:00
Santiago Pastorino
527cd8dfcd Merge pull request #22983 from bronson/update-mysql-in-guides
remove mentions of legacy mysql adapter from guides
2016-01-10 13:10:18 -03:00
Jon Moss
4973704bf5 Merge pull request #21995 from tak1n/master
Add Example for using config_for
2016-01-10 10:46:17 -05:00
Matthew Draper
78edeb3334 Merge pull request #22993 from akshay-vishnoi/travis-update
Update postgresql version to 9.4 for travis.
2016-01-10 13:47:51 +10:30
Sean Griffin
d8f535eeac Merge pull request #22992 from akshay-vishnoi/fix-docs
[ci skip] fix typo
2016-01-09 18:30:05 -07:00
Akshay Vishnoi
89773dbb80 Update postgresql version to 9.4 for travis.
Now available - https://docs.travis-ci.com/user/using-postgresql/
2016-01-10 04:31:22 +05:30
Kasper Timm Hansen
492d203986 Split out token if tests to trigger before_create.
When running passing condition assertions in the same test the user had already
been saved at that point.

Split out so we have a not yet persisted user.

Rename condition tests to improve clarity a bit.
2016-01-09 23:33:57 +01:00
Kasper Timm Hansen
2c1ac375c0 Revert "Switch has_secure_token to before_save."
Mistakenly interpreted the test case as a sign that we should switch to
before_save, when the original pitch use case was intended as before_create.

Revert a3ab6ad00872d24d4d87637f93fdae798d0edc79.
2016-01-09 23:28:34 +01:00
Kasper Timm Hansen
a3ab6ad008 Switch has_secure_token to before_save.
Adding `if` and `unless` support doesn't bode well if the callback to assign
a token only runs on create.

Switch to `before_save`, but keep the conditional so that no token already
assigned is overriden.
2016-01-09 23:21:18 +01:00
Kasper Timm Hansen
62abae9172 Add conditional_token to users.
Fix the NoMethodErrors introduced in 224eddf, when adding conditional token creation.

The model declarations but the column wasn't added to the schema.
2016-01-09 22:31:13 +01:00
Kasper Timm Hansen
224eddfc0e Merge pull request #20835 from glittershark/if-and-unless-in-secure-token
Support :if and :unless in has_secure_token
2016-01-09 22:30:21 +01:00
Akshay Vishnoi
1a43e4c522 [ci skip] fix typo 2016-01-10 02:04:35 +05:30
Griffin Smith
21c0a1f301 Support :if and :unless in has_secure_token
Pass through :if and :unless options from has_secure_token to the
generated before_create callback
2016-01-09 14:49:00 -05:00
Scott Bronson
8c629bf463 remove legacy mysql from guides to match #22715 2016-01-09 09:10:49 -08:00
Kasper Timm Hansen
9d681fc74c Merge pull request #22703 from joshsoftware/rake-log-clear
rake log:clear task updated
2016-01-09 18:02:28 +01:00