- 19 12月, 2014 1 次提交
-
-
由 Yves Senn 提交于
-
- 18 12月, 2014 11 次提交
-
-
由 Yves Senn 提交于
Closes #17945 `db:test:prepare` still purges the database to always keep the test database in a consistent state. This patch introduces new problems with `db:schema:load`. Prior to the introduction of foreign-keys, we could run this file against a non-empty database. Since every `create_table` containted the `force: true` option, this would recreate tables when loading the schema. However with foreign-keys in place, `force: true` wont work anymore and the task will crash. /cc @schneems
-
由 Godfrey Chan 提交于
Apparently PG does not validate against RFC 4122. The intent of the original patch is just to protect against PG errors (which potentially breaks txns, etc) because of bad user input, so we shouldn't try any harder than PG itself. Closes #17931
-
由 Abdelkader Boudih 提交于
[ci skip] Fix HTML format on comment
-
由 yui-knk 提交于
-
由 Zachary Scott 提交于
-
由 Zachary Scott 提交于
Fix name on changelog [ci skip]
-
由 Andrey Nering 提交于
-
由 Rafael Mendonça França 提交于
Replace AS::TimeWithZone#since with alias to +
-
由 Rafael Mendonça França 提交于
Use thread_safe gem version greater or equal to 0.3.4
-
由 Xavier Noria 提交于
The previous example was a little convoluted and the exposition claifying the parts that were correct albeit not totally obvious were interferring in my view. This example has less things going on and gets to the key problem with less balls in the air.
-
由 Evgeny Li 提交于
-
- 17 12月, 2014 21 次提交
-
-
由 Carlos Antonio da Silva 提交于
Remove unused line
-
由 Rafael Mendonça França 提交于
[ci skip] Change three backticks to just one
-
由 yui-knk 提交于
-
由 Ryuta Kamizono 提交于
-
由 Xavier Noria 提交于
fix link in autoloading guide [ci skip]
-
由 yuuji.yaginuma 提交于
-
由 claudiob 提交于
Stems from [Google group discussion](https://groups.google.com/forum/#!topic/rubyonrails-core/jSPbP-TNLb0). Currently `AS::TimeWithZone` has two methods to add an interval to a time: `+(other)` and `since(other)` ([docs](http://edgeapi.rubyonrails.org/classes/ActiveSupport/TimeWithZone.html)). The two methods are "pretty much" equivalent in every case: 1. When adding any interval to an `AS::TimeWithZone` representing a `Time`: ```ruby t = Time.now.in_time_zone #=> Thu, 04 Dec 2014 18:56:28 EST -05:00 t + 1 == t.since(1) #=> true t + 1.day == t.since(1.day) #=> true t + 1.month == t.since(1.month) #=> true ``` 2. When adding any interval to an `AS::TimeWithZone` representing a `Date`: ```ruby d = Date.today.in_time_zone #=> Thu, 04 Dec 2014 00:00:00 EST -05:00 d + 1 == d.since(1) #=> true d + 1.day == d.since(1.day) #=> true d + 1.month == d.since(1.month) #=> true ``` 3. When adding any interval to an `AS::TimeWithZone` representing a `DateTime`: ```ruby dt = DateTime.now.in_time_zone #=> Thu, 04 Dec 2014 18:57:28 EST -05:00 dt + 1 == dt.since(1) #=> true dt + 1.day == dt.since(1.day) #=> true dt + 1.month == dt.since(1.month) #=> false ``` As you can see, the only case in which they differ is when the interval added to a `DateTime` is in a format like `1.month`. However, this usage of "since" is explicitly discouraged by the [documentation of `DateTime#since`](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/date_time/calculations.rb#L86L88): > Returns a new DateTime representing the time a number of seconds since the instance time. > Do not use this method in combination with x.months, use months_since instead! And indeed, following this recommendation the correct result is returned: ```ruby dt + 1.month == dt.months_since 1 #=> true ``` Therefore, my proposal is to remove the method definition of `TimeWithZone#since` and instead replace it with a simple `alias_method :since, :+`. The rationale is that the only case where they differ is a case that is explicitly discouraged as "wrong". In my opinion, having two methods named `since` and `+` and having to figure out exactly what the difference is makes the codebase more confusing. However, I understand this PR is "subjective", so if you feel like it's better to ignore this, feel free to close the PR. Thanks!
-
由 Sean Griffin 提交于
In the case of serialized columns, we would expect the unserialized value as input, not the serialized value. The original issue which made this distinction, #14163, introduced a bug. If you passed serialized input to the method, it would double serialize when it was sent to the database. You would see the wrong input upon reloading, or get an error if you had a specific type on the serialized column. To put it another way, `update_column` is a special case of `update_all`, which would take `['a']` and not `['a'].to_yaml`, but you would not pass data from `params` to it. Fixes #18037
-
由 Rafael Mendonça França 提交于
Add class level case operator support for error dispatching in Rescuable
-
由 Rafael Mendonça França 提交于
Improving Method Chaining section [ci skip]
-
由 Andrey Nering 提交于
-
由 Rafael Mendonça França 提交于
assert template should raise ArgumentError for unsupported layout types
-
由 Zachary Scott 提交于
"backoffice" -> "back office", "lookup" -> "look up" [ci skip]
-
由 Carsten Wirth 提交于
-
由 Jon Atack 提交于
"Lookup" is a noun, but not a verb. The verb is "look up". [skip ci]
-
由 Rafael Mendonça França 提交于
Add a code checking about file or not to the rails db command
-
由 Rafael Mendonça França 提交于
allow reseting of request variants
-
由 Rafael Mendonça França 提交于
Add test for ActiveModel `after_validation`, `after_` and `around_` callbacks returning false
-
由 Rafael Mendonça França 提交于
Test to ensure content_tag works when fixing #17661
-
由 Rafael Mendonça França 提交于
Add test for `:skip_after_callbacks_if_terminated`
-
由 Jon Atack 提交于
After c2fe0938, which was reverted yesterday, there will likely be future PRs to address #17661. The test `actionview/test/template/capture_helper_test.rb #test_capture_returns_nil_if_the_returned_value_is_not_a_string` should have errored with c2fe0938, but it was rewritten in the PR to not raise. My guess is that it may have seemed irrelevant to the content_tag tests or already covered by them. This test provides additional protection by being in the content_tag test suite to explicitly raise a red flag in future cases. It foregoes some redundancy for safety — at least until #17661 is closed.
-
- 16 12月, 2014 7 次提交
-
-
由 Xavier Noria 提交于
Improve section in constant autoload guide
-
由 Rafael Mendonça França 提交于
Remove misleading test: around_action return false
-
由 Arthur Nogueira Neves 提交于
English fix [ci skip]
-
由 George Millo 提交于
-
由 Eileen M. Uchitelle 提交于
Improve grammar
-
由 Jon Atack 提交于
[skip ci]
-
由 Timo Schilling 提交于
The current implementation of `variants=` don't allow a resetting to nil, wich is the default value. This results in the following code smell: ```ruby case request.user_agent when /iPhone/ request.variants = :phone when /iPad/ request.variants = :ipad end ``` With the ability to reset variants to nil, it could be: ```ruby request.variants = case request.user_agent when /iPhone/ :phone when /iPad/ :ipad end ```
-