| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Remove needless `drop_table :test_limits`
|
|/
|
|
| |
A `:test_limits` table has not been created.
|
|\
| |
| | |
Prevent ActionMailer initializer from triggering load of ActionMailer
|
| |
| |
| |
| |
| |
| |
| |
| | |
the after_initialize block has been changed to use the configuration from
`config.action_mailer` rather than `ActionMailer::Base` so that action mailer
is not loaded before it is necessary.
the mailer preview routes setup have been moved out of an `on_load(:action_mailer)`
block.
|
|\ \
| |/
|/|
| |
| | |
prathamesh-sonpatki/fix-showing-of-deprecation-warning-for-legacy-migrations
Correctly show deprecation warning for incompatible migrations
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Tests on Travis are randomly failing because schema_migrations table
does not exist in teardown block.
- Also checked that all other places where we have used
`ActiveRecord::SchemaMigration.delete_all` we have rescued it, so used
it here also. This failure was not specifically related to the test
added in this PR but to overall compatibility migration tests, so
adding as separate commit.
|
| | |
|
|\ \
| | |
| | | |
Action Cable readme fix [ci skip]
|
| | | |
|
|\ \ \
| |/ /
|/| | |
Add `internal` attribute to routes
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is meant to provide a way for Action Cable, Sprockets, and possibly
other Rack applications to mark themselves as internal, and to exclude
themselves from the routing inspector, and thus `rails routes` / `rake
routes`.
I think this is the only way to have mounted Rack apps be marked as
internal, within AD/Journey. Another option would be to create an array
of regexes for internal apps, and then to iterate over that everytime a
request comes through. Also, I only had the first `add_route` method set
`internal`'s default to false, to avoid littering it all over the
codebase.
|
|\ \ \
| | | |
| | | | |
Full Action Cable documentation read through
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This PR checks all active Action Cable documentation for typos and other
fixes. It aims to make sure that when Rails 5 is released, that the
Action Cable docs are up to snuff with the other documentation included
with Rails.
[ci skip]
|
|\ \ \ \
| |_|/ /
|/| | | |
Assorted Railties generators work
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Once RubyGems 2.5.0 is required, then the duplicated files can be
removed, and symlinks can be used instead.
[ci skip]
|
| | | | |
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Make sure the parameter parsers register API work with overidden mime types.
|
| | | |
| | | |
| | | |
| | | | |
Also make sure we don't change the global state of our test suite.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This will keep our current API working without having the users to
change their codebases.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
After registering new `:json` mime type `parsers.fetch` can't find the mime type because new mime type is not equal to old one. Using symbol of the mime type as key on parsers hash solves the problem.
Closes #23766
|
|/ / /
| | |
| | |
| | |
| | | |
We should be able to pass options to minitest via TESTOPTS environment
variable
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
When `button_to 'Botton', url` form was being used the per form token
was not correct because the method that is was being used to generate it
was an empty string.
|
| | |
| | |
| | |
| | |
| | | |
We only need action and method so pass them explicitly instead of
merging the hash with HTML options.
|
|\ \ \
| | | |
| | | |
| | | | |
Fixed passing of delete method on button_to tag, creating wrong form csrf token
|
| | | |
| | | |
| | | |
| | | | |
them up.
|
| | | |
| | | |
| | | |
| | | | |
Fixes #23524
|
|\ \ \ \
| | | | |
| | | | | |
Fix `assert_in_delta` test failure
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`assert_in_delta` in `timestamp_test.rb` causes an intermittent test
failure. It looks like that caused by subseconds truncation in MySQL 5.5.
Example:
```
1) Failure:
TimestampTest#test_touching_many_attributes_updates_them [/home/travis/build/rails/rails/activerecord/test/cases/timestamp_test.rb:125]:
Expected |2016-02-06 09:22:10 +0000 - 2016-02-06 09:22:09 UTC| (1.000837185) to be <= 1.
```
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix NoMethodError preparable for Arel::Visitors::PostgreSQL
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
is falsy
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Add test cases about MySQL ORDER BY FIELD()
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Add assertions to MySQL `ORDER BY FIELD()` with empty data.
These tests examine to sanitize `ORDER BY FIELD()` with empty data
appropriately.
```ruby
Tag.order(['field(id, ?)', []]).to_sql
# => SELECT "tags".* FROM "tags" ORDER BY field(id, NULL)
Tag.order(['field(id, ?)', nil]).to_sql
# => SELECT "tags".* FROM "tags" ORDER BY field(id, NULL)
```
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fix typographical error
|
|/ / / / / / / |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Remove `alias exec_without_stmt exec_query`
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This alias was for compatibility with legacy mysql adapter.
But the return value of both methods is already inconsistent.
`exec_query` returns `ActiveRecord::Result` instance.
But `exec_without_stmt` returns `[result_set, affected_rows]`
https://github.com/rails/rails/blob/v4.2.5.1/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb#L335-L364
Legacy mysql adapter was already removed in Rails 5.0.
I think we can remove this inconsistent alias.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Improve the performance of string xor operation
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Use `each_byte` instead of `bytes` to speed up string xor operation and
reduce object allocations.
Inspired by commit 02c3867882d6d23b10df262a6db5f937ca69fb53.
``` ruby
require 'benchmark/ips'
require 'allocation_tracer'
a = 32.times.map { rand(256) }.pack('C*')
b = 32.times.map { rand(256) }.pack('C*')
def xor_byte_strings1(s1, s2)
s1.bytes.zip(s2.bytes).map { |(c1,c2)| c1 ^ c2 }.pack('c*')
end
def xor_byte_strings2(s1, s2)
s2_bytes = s2.bytes
s1.bytes.map.with_index { |c1, i| c1 ^ s2_bytes[i] }.pack('c*')
end
def xor_byte_strings3(s1, s2)
s2_bytes = s2.bytes
s1.each_byte.with_index { |c1, i| s2_bytes[i] ^= c1 }
s2_bytes.pack('C*')
end
fail if xor_byte_strings1(a, b) != xor_byte_strings2(a, b)
fail if xor_byte_strings1(a, b) != xor_byte_strings3(a, b)
Benchmark.ips do |x|
x.report('xor_byte_strings1') { xor_byte_strings1(a, b) }
x.report('xor_byte_strings2') { xor_byte_strings2(a, b) }
x.report('xor_byte_strings3') { xor_byte_strings3(a, b) }
x.compare!
end
Tracer = ObjectSpace::AllocationTracer
Tracer.setup(%i{type})
p xor_byte_strings1: Tracer.trace { xor_byte_strings1(a, b) }
p xor_byte_strings2: Tracer.trace { xor_byte_strings2(a, b) }
p xor_byte_strings3: Tracer.trace { xor_byte_strings3(a, b) }
```
```
Warming up --------------------------------------
xor_byte_strings1 10.668k i/100ms
xor_byte_strings2 11.814k i/100ms
xor_byte_strings3 13.139k i/100ms
Calculating -------------------------------------
xor_byte_strings1 116.667k (± 3.1%) i/s - 586.740k
xor_byte_strings2 129.932k (± 4.3%) i/s - 649.770k
xor_byte_strings3 142.506k (± 4.2%) i/s - 722.645k
Comparison:
xor_byte_strings3: 142506.3 i/s
xor_byte_strings2: 129932.4 i/s - 1.10x slower
xor_byte_strings1: 116666.8 i/s - 1.22x slower
{:xor_byte_strings1=>{[:T_ARRAY]=>[38, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}}
{:xor_byte_strings2=>{[:T_ARRAY]=>[3, 0, 0, 0, 0, 0], [:T_DATA]=>[1, 0, 0, 0, 0, 0], [:T_IMEMO]=>[2, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}}
{:xor_byte_strings3=>{[:T_ARRAY]=>[1, 0, 0, 0, 0, 0], [:T_DATA]=>[1, 0, 0, 0, 0, 0], [:T_IMEMO]=>[2, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}}
```
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Adding test to verify the last week when the year is leap
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Fixing failing specification for verifying the last week when the year is leap
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Reduce `attribute.to_s`
|
| | | | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
Remove unused parameter from method
|
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
The `attribute` parameter is not used inside the `normalize_detail`
method. This does not need to go through a deprecation cycle, since the
method is private.
|
|\ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | |
| | | | | | | | | | | | | |
Match test name to test (typo)
|
| | | | | | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \ \ \ \
| |/ / / / / / / / / / / /
|/| | | | | | | | | | | | |
Add a note about downcasing submit tag
|