- 15 3月, 2017 2 次提交
-
-
由 Andrew White 提交于
-
由 Andrew White 提交于
Adding durations to `Time` instances is perfectly okay.
-
- 08 3月, 2017 1 次提交
-
-
由 Krzysztof Zych 提交于
-
- 02 3月, 2017 1 次提交
-
-
由 Andrew White 提交于
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.
-
- 24 2月, 2017 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 22 2月, 2017 1 次提交
-
-
由 Jon Moss 提交于
[ci skip]
-
- 07 2月, 2017 1 次提交
-
-
由 Stan Lo 提交于
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
-
- 04 2月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
-
- 31 1月, 2017 10 次提交
-
-
由 Eugene Kenny 提交于
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.
-
由 yuuji.yaginuma 提交于
-
由 Rafael Mendonça França 提交于
Also change the class_methods to ClassMethods since the former document the method as an instance method of Parameterized not as a class method.
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
We own the class so we can override the initialize.
-
由 Rafael Mendonça França 提交于
-
- 30 1月, 2017 1 次提交
-
-
由 David Heinemeier Hansson 提交于
Needed for testing of parameterized mailers
-
- 29 1月, 2017 1 次提交
-
-
由 Kasper Timm Hansen 提交于
-
- 28 1月, 2017 2 次提交
-
-
由 yuuji.yaginuma 提交于
Currently use two variables to restore `delivery_method`, but the order of restoring the values is incorrect and does not restore is correctly.
-
由 David Heinemeier Hansson 提交于
Offer the option to use parameterization for shared processing of headers and ivars
-
- 17 1月, 2017 1 次提交
-
-
由 Akira Matsuda 提交于
we call them only in the tests
-
- 15 1月, 2017 2 次提交
-
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
- 12 1月, 2017 1 次提交
-
-
由 Akira Matsuda 提交于
(I personally prefer writing one string in one line no matter how long it is, though)
-
- 11 1月, 2017 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 06 1月, 2017 1 次提交
-
-
由 MQuy 提交于
-
- 05 1月, 2017 1 次提交
-
-
由 Akira Matsuda 提交于
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
-
- 04 1月, 2017 2 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit 1e969bfb, reversing changes made to a5041f26. Reason: It breaks the public API
-
由 Rafael Mendonça França 提交于
-
- 03 1月, 2017 1 次提交
-
-
由 Fumiaki MATSUSHIMA 提交于
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.
-
- 31 12月, 2016 1 次提交
-
-
由 Jon Moss 提交于
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]
-
- 24 12月, 2016 2 次提交
-
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
- 23 12月, 2016 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 06 12月, 2016 1 次提交
-
-
由 MQuy 提交于
-
- 05 12月, 2016 1 次提交
-
-
由 MQuy 提交于
-
- 01 12月, 2016 1 次提交
-
-
由 MQuy 提交于
-
- 30 11月, 2016 1 次提交
-
-
由 MQuy 提交于
-