| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| | |
".. with __dir__ we can restore order in the Universe." - by @fxn
Related to 5b8738c2df003a96f0e490c43559747618d10f5f
|
| | |
|
| | |
|
| |\
| | |
| | | |
Add missing require in ActionMailer::Base
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Without this, Action Mailer doesn't work like it used to on version 4.
The following snippet fails since version 5:
> require 'action_mailer'
> ActionMailer::Base
NameError: uninitialized constant ActiveSupport::Rescuable
|
|/ /
| |
| |
| |
| | |
This will avoid to the test fail when running in isolation because the
message generated is nil.
|
|\ \
| |/
|/| |
Pass request params to ActionMailer::Preview
|
| | |
|
| |
| |
| |
| |
| | |
`ActionMailer::Base.delivery_method` is already defined in
https://github.com/rails/rails/blob/master/actionmailer/test/parameterized_test.rb#L13
|
| | |
|
| | |
|
| |
| |
| |
| | |
Adding durations to `Time` instances is perfectly okay.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently `ActiveSupport::Duration` implicitly converts to a seconds
value when used in a calculation except for the explicit examples of
addition and subtraction where the duration is the receiver, e.g:
>> 2 * 1.day
=> 172800
This results in lots of confusion especially when using durations
with dates because adding/subtracting a value from a date treats
integers as a day and not a second, e.g:
>> Date.today
=> Wed, 01 Mar 2017
>> Date.today + 2 * 1.day
=> Mon, 10 Apr 2490
To fix this we're implementing `coerce` so that we can provide a
deprecation warning with the intent of removing the implicit coercion
in Rails 5.2, e.g:
>> 2 * 1.day
DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration
to a Numeric is deprecated and will raise a TypeError in Rails 5.2.
=> 172800
In Rails 5.2 it will raise `TypeError`, e.g:
>> 2 * 1.day
TypeError: ActiveSupport::Duration can't be coerced into Integer
This is the same behavior as with other types in Ruby, e.g:
>> 2 * "foo"
TypeError: String can't be coerced into Integer
>> "foo" * 2
=> "foofoo"
As part of this deprecation add `*` and `/` methods to `AS::Duration`
so that calculations that keep the duration as the receiver work
correctly whether the final receiver is a `Date` or `Time`, e.g:
>> Date.today
=> Wed, 01 Mar 2017
>> Date.today + 1.day * 2
=> Fri, 03 Mar 2017
Fixes #27457.
|
| |
|
|
|
|
| |
[ci skip]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ActionMailer::Base#instrument_name and
ActionController::Base#instrument_name will be frequently called once
caching is enabled. So it's better to freeze them instead of create new
string on every call.
Also, the instrument name in #instrument_fragment_cache will usually
be "write_fragment.action_controller" or
"read_fragment.action_controller". So freezing them might also gain some
performance improvement. We have done something like this in other places:
https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
|
| |
|
|
|
|
|
|
|
|
| |
The raw_source method is documented as returning the exact value that
was used to create the body; mutating it breaks that contract.
Additionally, if the value used to create the body is blank, raw_source
returns a frozen string which causes the interceptor to raise an error.
|
| |
|
|
|
|
|
| |
Also change the class_methods to ClassMethods since the former document
the method as an instance method of Parameterized not as a class method.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
We own the class so we can override the initialize.
|
| |
|
|
|
|
|
|
| |
parameterized delivery jobs
Needed for testing of parameterized mailers
|
| |
|
|
|
|
|
| |
Currently use two variables to restore `delivery_method`, but the order
of restoring the values is incorrect and does not restore is correctly.
|
|
|
|
|
| |
and ivars (#27825)
Offer the option to use parameterization for shared processing of headers and ivars
|
|
|
|
| |
we call them only in the tests
|
| |
|
|
|
|
| |
call `super`
|
|
|
|
| |
(I personally prefer writing one string in one line no matter how long it is, though)
|
| |
|
|\
| |
| |
| | |
Allow to custom content type when setting mailer body
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
mtsmfm/fix-generator-command-for-nested-rails-engine"
This reverts commit 1e969bfb98b88799e2c759fce25a1d8cf00d7ce7, reversing
changes made to a5041f267ded119c2d00b8786c2f2c1e3f93c8a1.
Reason: It breaks the public API
|
|\ \
| | |
| | |
| | |
| | | |
mtsmfm/fix-generator-command-for-nested-rails-engine
Fix generator command for nested (namespaced) rails engine
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If we create nested (namespaced) rails engine such like bukkits-admin,
`bin/rails g scaffold User name:string age:integer`
will create
`bukkits-admin/app/controllers/bukkits/users_controller.rb`
but it should create
`bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`.
In #6643, we changed `namespaced_path` as root path
because we supposed application_controller is always in root
but nested rails engine's application_controller will not.
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Per https://www.timeanddate.com/counters/firstnewyear.html, it's already
2017 in a lot of places, so we should bump the Rails license years to
2017.
[ci skip]
|
| | |
|