| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
- The query needs to be executed for hitting `select_all` so made sure
that query gets executed.
- Also instead of changing instance variable, just add new
configuration for prepared_statements: false and use it for this
test.
- This way we don't have to touch the internals of AR code and still
disable prepared statements config for this test.
|
|\
| |
| |
| | |
Fix incorrect output from rails routes when using singular resources …
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
#26606
Rails routes (even rake routes in previous versions) output showed incorrect routes when an application use resource :controller, implying that edit_controller_path match with controller#show.
The order of the output has changed to correct this. View #26606 for more information.
Added a test case, change unit test in rake to expect the new output.
Since the output of resource :controller is changing, the string spected of the railties/test/application/rake_test.rb test_rails_routes_with_controller_environment had to be modified.
|
|\ \
| | |
| | | |
Use secure source for gems referencing "github" in the generated apps
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- New apps generated on master and latest bundler give warning about
"github" source being insecure.
- Use the same solution used for Rails master in the generated app's
Gemfile to fix this issue.
|
|\ \ \
| | | |
| | | |
| | | | |
Fix unexpected session sharing
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Reset a new session directly after its creation in
`ActionDispatch::IntegrationTest#open_session`. Reset the session to a clean
state before making it available to the client's test code.
Issue #22742 reports unexpected behavior of integration tests that run multiple
sessions. For example an `ActionDispatch::Flash` instance is shared across
multiple sessions, though a client code will rightfully assume that each new
session has its own flash hash.
The following test failed due to this behavior:
class Issue22742Test < ActionDispatch::IntegrationTest
test 'issue #22742' do
integration_session # initialize first session
a = open_session
b = open_session
refute_same(a.integration_session, b.integration_session)
end
end
Instead of creating a new `ActionDispatch::Integration::Session` instance,
the same instance is shared across all newly opened test sessions. This is
due to the way how new test sessions are created in
`ActionDispatch::IntegrationTest#open_session`. The already existing
`ActionDispatch::IntegrationTest` instance is duplicated with `Object#dup`,
This approach was introduced in commit 15c31c7639b. `Object#dup` copies the
instance variables, but not the objects they reference. Therefore this issue
only occurred when the current test instance had been tapped in such a way that
the instance variable `@integration_session` was initialized before creating the
new test session.
Close #22742
[Tawan Sierek + Sina Sadeghian]
|
|\ \ \
| |/ /
|/| | |
remove Ruby warning from Active Job test helper methods
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
This removes the following warnings.
```
/home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:241: warning: shadowing outer local variable - job
/home/travis/build/rails/rails/activejob/lib/active_job/test_helper.rb:265: warning: shadowing outer local variable - job
```
|
|\ \
| | |
| | | |
Fixed CONTENT_LENGTH header in ActionController::TestRequest
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
CONENT_LENGTH setted by string length, which is equal to number of
characters in string but StringIO.length is byte sequence and
when payload contains non-ASCII characters, stream's length will be
different. That's why real byte length should be used for CONTENT_LENGTH
header.
Add unit test for CONTENT_LENGTH header fix
It just passes non-ascii symbols as parameters and verifies that
"CONTENT_LENGTH" header has content bytes count as value.
|
|\ \ \
| | | |
| | | | |
Should except `:distinct` rather than `:order` for `exists?`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Records fetching order is very important for performance if `limit` is
presented. Should not except the order in the case.
And `exists?` replaces select list to `1 AS one` therefore `:distinct`
is useless (`DISTINCT 1 AS one`). And PostgreSQL raises the following
error if `:distinct` and `:order` are used in the same time.
```
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
```
|
|\ \ \ \
| | | | |
| | | | | |
Updated Sprockets Documentation
|
| | |_|/
| |/| | |
|
|\ \ \ \
| |/ / /
|/| | | |
Removes 'raw: true' from MemCacheStore#read_multi
|
| | | |
| | | |
| | | |
| | | | |
https://github.com/rails/rails/issues/27066.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
use `force_encoding` instread of `encode!` to avoid `UndefinedConversionError`
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`PG::TextEncoder::Array#encode` returns the encoded value with `ASCII-8BIT`.
But in some cases, trying to convert `ASCII-8BIT` to `UTF-8` cause an error.
```ruby
"{\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB}".encode!(Encoding::UTF_8)
# => Encoding::UndefinedConversionError: "\xE3" from ASCII-8BIT to UTF-8
```
Should use `force_encoding` to avoid this error.
Follow up to 7ba3a48df5bfdc5e98506bb829f937e03b55a5b3
Ref: https://github.com/rails/rails/pull/23619#issuecomment-189924036
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
kamipo/respect_new_records_for_collection_proxy_distinct
Respect new records for `CollectionProxy#uniq`
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Currently if `CollectionProxy` has more than one new record,
`CollectionProxy#uniq` result is incorrect.
And `CollectionProxy#uniq` was aliased to `distinct` in a1bb6c8b06db.
But the `uniq` method and the `SELECT DISTINCT` method are different
methods. The doc in `CollectionProxy` is for the `SELECT DISTINCT`
method, not for the `uniq` method.
Therefore, reverting the alias in `CollectionProxy` to fix the
inconsistency and to have the both methods.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The issue presented in #26246 showed a deeper underlying problem. When
we fell back to the exception handler for an exceptions cause, we were
calling that handler with the outer raised exception. This breaks the
calling code's expectations, especially if the exception has methods on
it behond those from `StandardError`.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
section already speaks about sanitization as a safety measure. [ci skip] (#27086)
Fixes #27085
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix mucking of connection_config leading to issues in prepared_statements issues
|
|/ / / / / / |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix PG prepared statement test
|
|/ / / / / / |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Enable JRuby testing for Active Job
|
| | | | | | | |
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | | |
All tests pass for me locally.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
maxboisvert/use_named_parameters_in_assert_enqueued_with
Use named parameters instead of `assert_valid_keys` in active_job/test_helper
|
| | |_|/ / /
| |/| | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Run tests by Ruby 2.2.6 and 2.3.2
|
| |/ / / / / |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Enable JRuby testing for Action Mailer
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
All tests passing locally for me:
```
195 runs, 441 assertions, 0 failures, 0 errors, 0 skips
```
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The relation method `update_all` allows you to pass a SQL fragment. The
functionality is already mentioned in the prose but the examples section
does not cover it.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix testing isolation
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
AS::Testing::Isolation has two ways to isolate the process:
forking and subprocessing. The second way is used on JRuby and other
platforms that don't support forking.
The way how subprocessing works is that we prepare a command to run a
new process:
```
/opt/rubies/2.3.0/bin/ruby -I{skipped_load_path} test/initializable_test.rb '' -nInitializableTests::Basic#test_Initializer_provides_context's_class_name
```
As you see, there's unescaped quote at the end of the line.
It leads to:
```
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
```
This fixes tests on MRI + NO_FORK variable and on JRuby :tada:
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Support AC::Parameters for PG HStore
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As reported via #26904, there is a regression in how values for
Postgres' HStore column type are being processed, beginning in Rails 5.
Currently, the way that Active Record checks whether or not values need
to be serialized and put into the correct storage format is whether or
not it is a `Hash` object. Since `ActionController::Parameters` no
longer inherits from `Hash` in Rails 5, this conditional now returns
false. To remedy this, we are now checking to see whether the `value`
parameters being passed in responds to a certain method, and then
calling the `serialize` method, except this time with a real Hash
object. Keeping things DRY!
Fixes #26904.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Refactor `NullRelation#calculate`
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Before:
```ruby
def calculate(operation, _column_name)
if [:count, :sum].include? operation
group_values.any? ? Hash.new : 0
elsif [:average, :minimum, :maximum].include?(operation) && group_values.any?
Hash.new
else
nil
end
end
```
After:
```ruby
def calculate(operation, _column_name)
case operation
when :count, :sum
group_values.any? ? Hash.new : 0
when :average, :minimum, :maximum
group_values.any? ? Hash.new : nil
end
end
```
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Without this, bundler tries to bundle json 1.8 on Ruby 2.4 in some cases
https://travis-ci.org/rails/rails/jobs/175874852
|
|\ \ \ \
| | | | |
| | | | | |
remove `alias_method_chain` from guide [ci skip]
|
| | |/ /
| |/| |
| | | |
| | | | |
Follow up to 7c848e6dd493ff236d33a0410a92f4c3e5cc3c7f
|
|\ \ \ \
| |/ / /
|/| | | |
remove duplicated changelog entry [ci skip]
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Fix small typo in Layouts and Rendering guide.
|