| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Fix typo in method name
|
|/ |
|
|
|
|
| |
[ci skip]
|
| |
|
|\
| |
| | |
Default protect from forgery
|
| |
| |
| |
| |
| |
| | |
Since we now default to `protect_from_forgery with: :exception`,
provide a wrapper to `skip_before_action :verify_authenticity_token`
for disabling forgery protection.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Rather than protecting from forgery in the generated
ApplicationController, add it to ActionController::Base by config. This
configuration defaults to false to support older versions which have
removed it from their ApplicationController, but is set to true for
Rails 5.2.
|
|\ \
| |/
|/| |
Don't eagerly require Rails' minitest plugin.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By making the Rails minitest behave like a standard minitest plugin
we're much more likely to not break when people use other minitest
plugins. Like minitest-focus and pride.
To do this, we need to behave like minitest: require files up front
and then perform the plugin behavior via the at_exit hook.
This also saves us a fair bit of wrangling with test file loading.
Finally, since the environment and warnings options have to be applied
as early as possible, and since minitest loads plugins at_exit, they
have to be moved to the test command.
* Don't expect the root method.
It's likely this worked because we eagerly loaded the Rails minitest plugin
and that somehow defined a root method on `Rails`.
* Assign a backtrace to failed exceptions.
Otherwise Minitest pukes when attempting to filter the backtrace (which
Rails' backtrace cleaner then removes).
Means the exception message test has to be revised too.
This is likely caused by the rails minitest plugin now being loaded for
these tests and assigning a default backtrace cleaner.
|
|
|
|
| |
Time.now` (#29681)
|
|\
| |
| |
| |
| | |
y-yagi/make_sidekiq_and_resque_integration_tests_work_in_ci
Make sidekiq and resque integration tests work in CI
|
|/
|
|
|
|
|
|
|
| |
Since f55ecc6, the integration test of sidekiq and resque is not working
in CI.
https://travis-ci.org/rails/rails/jobs/251783876
Because f55ecc6 required a password to access redis.
Therefore, handling by passing passwords when connecting to redis.
|
|\
| |
| | |
Use frozen-string-literal in ActiveJob
|
|/ |
|
|\
| |
| | |
[ci skip] Updated language on validations.
|
| | |
|
|\ \
| |/
|/| |
Update MessageEncryptor example to use dynamic key length
|
| |
| |
| |
| | |
by OpenSSL
|
|\ \
| | |
| | | |
Treat secrets as binary
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Until Rails 5.1.1 secrets was treated as binary inside Rails.
https://github.com/rails/rails/blob/v5.1.1/railties/lib/rails/secrets.rb#L59
https://github.com/rails/rails/blob/v5.1.1/railties/lib/rails/secrets.rb#L63
However, it is treated as String in Rails 5.1.2(changed by 157db872103429e8782b62d1cb5d1d91337177a7).
https://github.com/rails/rails/blob/v5.1.2/railties/lib/rails/secrets.rb#L104
https://github.com/rails/rails/blob/v5.1.2/railties/lib/rails/secrets.rb#L108
As a result, when upgrading from Rails 5.1.1 to 5.1.2, to write the value
treated as binary using `File.write`, causing an error.
In order to avoid `UndefinedConversionError`, fixed it to treat it as
binary like 5.1.1.
Fixes #29696
|
|\ \ \
| | | |
| | | | |
Load environment file in `dbconsole` command
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Currently the environment file is not loaded in `dbconsole` command.
Therefore, for example, if use encrypted secrets values in database.yml,
`read_encrypted_secrets` will not be true, so the value can not be
used correctly.
Fixes #29717
|
|\ \ \
| | | |
| | | | |
Prepare AP and AR to be frozen string friendly
|
| | | | |
|
|\ \ \ \
| |_|/ /
|/| | | |
Use frozen-string-literal in ActiveSupport
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
Don't allow uuids with orphan curly braces
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The uuid validation regex was allowing uuids to have a single leading
curly brace or single trailing curly brace. Saving with such a uuid
would cause Postgres to generate an exception even though the record
seemed valid. With this change, the regex requires both a leading *and*
a trailing curly brace or neither to be valid.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Skip query cache for in_batches and friends
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The `find_each`, `find_in_batches` and `in_batches` APIs usually operate
on large numbers of records, where it's preferable not to load them all
into memory at once.
If the query cache is enabled, it will hold onto the query results until
the end of the execution context (request/job), which means the memory
used is still proportional to the total number of records. These queries
are typically not repeated, so the query cache isn't desirable here.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Don't translate non-database exceptions.
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Whoops.
|
| | | | | | |
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
The AbstractAdapter will translate all StandardErrors generated during the course of a query into ActiveRecord::StatementInvalids. Unfortunately, it'll also mangle non-database-related errors generated in ActiveSupport::Notification callbacks after the query has successfully completed. This should prevent it from translating errors from ActiveSupport::Notifications.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
palkan/fix/action-cable-postgres-identifiers-limit
Fix bug with long stream identifiers when using Postgres adapter
|
| |/ / / / |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Improve the performance of writing attributes
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This name more accurately describes what the method does, and also
disambiguates it from `_write_attribute`, which ignores aliases.
We can also make the method private, since it's not public API and only
called from one place - `update_columns` - without an explicit receiver.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Using a similar approach to 08576b94ad4f19dfc368619d7751e211d23dcad8,
this change adds a new internal `_write_attribute` method which bypasses
the code that checks for attribute aliases and custom primary keys.
We can use this method instead of `write_attribute` when we know that we
have the name of the actual column to be updated and not an alias.
This makes writing an attribute with `attribute=` about 18% faster.
Benchmark:
```
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", github: "rails/rails"
gem "arel", github: "rails/arel"
gem "sqlite3"
gem "benchmark-ips"
end
require "active_record"
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Schema.define do
create_table :posts, force: true do |t|
end
end
class Post < ActiveRecord::Base
end
post = Post.new(id: 1)
Benchmark.ips do |x|
x.report("attribute=") { post.id = post.id + 1 }
end
```
Before:
Warming up --------------------------------------
attribute= 25.889k i/100ms
Calculating -------------------------------------
attribute= 290.946k (± 3.1%) i/s - 1.476M in 5.077036s
After:
Warming up --------------------------------------
attribute= 30.056k i/100ms
Calculating -------------------------------------
attribute= 345.088k (± 4.8%) i/s - 1.743M in 5.064264s
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Add `rails secrets:show` command
|