| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |/ / / / / / / / |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Add `logger.debug?` guard to `ActionMailer::LogSubscriber#process`
|
| |/ / / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
*TLDR*: The method is 4 times faster when log level is higher than DEBUG.
Also, the other two methods, `#deliver` and `#receive` have similar guard statements,
so this commit adds some symmetry to the code.
This is probably not the most critical part of ActionMailer in terms
of performance, but here are some benchmarks:
```
require 'benchmark/ips'
require 'action_mailer'
event = ActiveSupport::Notifications::Event.new(
'process.action_mailer',
Time.now,
Time.now,
'bf4e2b36ce085fd35b24',
{ mailer: "UserMailer", action: :welcome }
)
ActionMailer::Base.logger = ActiveSupport::Logger.new '/dev/null'
subscriber = ActionMailer::LogSubscriber.new
def subscriber.process_with_guard(event)
return unless logger.debug?
mailer = event.payload[:mailer]
action = event.payload[:action]
debug("\n#{mailer}##{action}: processed outbound mail in #{event.duration.round(1)}ms")
end
Benchmark.ips do |r|
ActionMailer::Base.logger.level = ::Logger::Severity::INFO
r.report('no guard') { subscriber.process(event) }
r.report(' guard') { subscriber.process_with_guard(event) }
end
__END__
Calculating -------------------------------------
no guard 9640 i/100ms
guard 38381 i/100ms
-------------------------------------------------
no guard 169166.9 (±10.2%) i/s - 838680 in 5.007262s
guard 728184.9 (±9.6%) i/s - 3607814 in 4.999218s
```
When log level is DEBUG, the _guarded_ method is a bit slower. This is a
good tradeoff for 4x improvement in production mode.
```
Benchmark.ips do |r|
ActionMailer::Base.logger.level = ::Logger::Severity::DEBUG
r.report('no guard') { subscriber.process(event) }
r.report(' guard') { subscriber.process_with_guard(event) }
end
__END__
Calculating -------------------------------------
no guard 4970 i/100ms
guard 4564 i/100ms
-------------------------------------------------
no guard 55617.4 (±3.5%) i/s - 278320 in 5.010523s
guard 49452.1 (±5.6%) i/s - 251020 in 5.093358s
```
|
|\ \ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
remove unused method from Postgresql::Adapter
|
|/ / / / / / / / |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
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.
|
|\ \ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | |
| | | | | | | |
| | | | | | | | |
zuhao/refactor_activesupport_time_zone_test_helpers
Extract out with_env_tz helper method.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
It’s used at so many places that extracting it out into a helper file
is worth doing.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Move cleanup into teardown, delete obsolete code.
|
| | | | | | | | | |
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Don't type cast the default on the column
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
If we want to have type decorators mess with the attribute, but not the
column, we need to stop type casting on the column. Where possible, we
changed the tests to test the value of `column_defaults`, which is
public API. `Column#default` is not.
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Detect in-place changes on point types
|
| | | | | | | | | | | |
|
|/ / / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
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.
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Enable hstore in array tests
|
|/ / / / / / / / / / |
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Detect mutations of arrays and array members
|
|/ / / / / / / / / / |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
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
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Ensure `OID::Array#type_cast_for_database` matches PG's quoting behavior
|
|/ / / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Also takes a step towards supporting types which use a character other
than ',' for the delimiter (`box` is the only built in type for which
this is the case)
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Move pg array database type casting to the Array type
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
The case where we have a column object, but don't have a type cast
method involves type casting the default value when changing the schema.
We get one of the column definition structs instead. That is a case that
I'm trying to remove overall, but in the short term, we can achieve the
same behavior without needing to pass the adapter to the array type by
creating a fake type that proxies to the adapter.
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
Add an option to skip installation of Turbolinks
|
| | | | | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \ \ \
| |_|_|/ / / / / / / / /
|/| | | | | | | | | | | |
Add test cases for Migration#inverse_of
|
| | | | | | | | | | | | |
|
| | | | | | | | | | | | |
|
| | | | | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | |
| | | | | | | | | | | | | |
Don't assume that Hstore columns have always changed
|
| | |_|/ / / / / / / / /
| |/| | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
HStore columns come back from the database separated by a comma and a
space, not just a comma. We need to mirror that behavior since we
compare the two values.
Also adds a regression test against JSON to ensure we don't have the
same bug there.
|
|\ \ \ \ \ \ \ \ \ \ \ \
| |/ / / / / / / / / / /
|/| | | | | | | | | | | |
Use `column_defaults` in dirty for checking changed defaults
|
|/ / / / / / / / / / /
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
We no longer need to "init changed attributes" from the initializer,
either, as there is no longer a case where a given value would differ
from the default, but would not already be marked as changed.
|
|\ \ \ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|_|/ / /
|/| | | | | | | | | | |
Don't mess with `column_defaults` when optimistic locking is enabled
|
|/ / / / / / / / / / |
|
|\ \ \ \ \ \ \ \ \ \
| |_|_|_|/ / / / / /
|/| | | | / / / / /
| | |_|_|/ / / / /
| |/| | | | | | | |
Move test teardown into `ensure` block.
|
|/ / / / / / / / |
|
| | | | | | | | |
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
[ci skip] doc corrected : ActiveRecord::Base.connections to ActiveRecord::Base.configurations
|
|/ / / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | | |
ActiveRecord::Base.configurations
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Promote time zone aware attributes to a first class type decorator
|
|/ / / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This refactoring revealed the need for another form of decoration, which
takes a proc to select which it applies to (There's a *lot* of cases
where this form can be used). To avoid duplication, we can re-implement
the old decoration in terms of the proc-based decoration.
The reason we're `instance_exec`ing the matcher is for cases such as
time zone aware attributes, where a decorator is defined in a parent
class, and a method called in the matcher is overridden by a child
class. The matcher will close over the parent, and evaluate in its
context, which is not the behavior we want.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Refactor application of type decorators into an object
|