- 12 2月, 2015 9 次提交
-
-
由 Sean Griffin 提交于
It looks like the only reason `current_scope` was thread local on `base_class` instead of `self` is to ensure that when we call a named scope created with a proc on the parent class, it correctly uses the default scope of the subclass. The reason this wasn't happening was because the proc captured `self` as the parent class, and we're not actually defining a real method. Using `instance_exec` fixes the problem. Fixes #18806
-
由 Rafael Mendonça França 提交于
Refactor `quote_default_expression`
-
由 Rafael Mendonça França 提交于
Fixes incorrect wording of test description
-
由 Rafael Mendonça França 提交于
Accept a collection in fresh_when and stale?
-
由 Rafael Mendonça França 提交于
Remove some code duplication in ActionView tags code
-
由 Rafael Mendonça França 提交于
This caused a performance regression since we were decided to do the nil check in run time not in the load time. See https://github.com/rails/rails/pull/15187#issuecomment-71760058
-
由 Adam Doeler 提交于
-
由 Sean Griffin 提交于
As far as I can tell, the original reason that this behavior was added has been sufficiently resolved elsewhere, as we no longer remove the encoding of strings coming out of the database.
-
由 eileencodes 提交于
Freezing the string literal reduces the number of objects allocated during integration test runs. AllocationTracer before: ``` [["/rack/lib/rack/utils.rb", 499, :T_STRING], [50939, 2737, 78553, 0, 13, 1783920]] [["/rails/activesupport/lib/active_support/subscriber.rb", 99, :T_STRING], [44959, 0, 42633, 0, 2, 1670800]] [["/rack/lib/rack/utils.rb", 662, :T_STRING], [32979, 0, 31263, 0, 1, 1226009]] [["/rack/lib/rack/body_proxy.rb", 34, :T_ARRAY], [29988, 0, 28438, 0, 1, 1114320]] [["/rails/activesupport/lib/active_support/callbacks.rb", 165, :T_DATA], [29968, 0, 28422, 0, 2, 3675936]] ``` AllocationTracer after: ``` [["/rack/lib/rack/utils.rb", 499, :T_STRING], [50983, 4080, 67269, 0, 12, 1815600]] [["/rack/lib/rack/utils.rb", 662, :T_STRING], [33001, 0, 28420, 0, 2, 1230809]] [["/rack/lib/rack/body_proxy.rb", 34, :T_ARRAY], [29990, 0, 25812, 0, 1, 1118000]] [["/rails/activesupport/lib/active_support/subscriber.rb", 99, :T_STRING], [29986, 0, 25803, 0, 1, 1117840]] [["/rails/activesupport/lib/active_support/notifications/instrumenter.rb", 52, :T_HASH], [29984, 28, 26133, 0, 11, 4953280]]
-
- 11 2月, 2015 31 次提交
-
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
The latest version of the PG gem can actually convert the primitives for us in C code, which gives a pretty substantial speed up. A few cases were only there to add the `infinity` method, which I just put on the range type (which is the only place it was used). Floats also needed to parse `Infinity` and `NaN`, but it felt reasonable enough to put that on the generic form.
-
由 Sean Griffin 提交于
The datetime precision with zero should be dumped
-
由 Bogdan Gusiev 提交于
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
MySQL rejects to remove an index which is used in a foreign key constraint: ``` ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_copies_on_title_id': needed in a foreign key constraint: ALTER TABLE `copies` DROP `title_id` ``` Removing the constraint before removing the column (and the index) solves this problem.
-
由 Yves Senn 提交于
Remove `cast_type` in `ColumnDefinition`
-
由 Yves Senn 提交于
/cc @zzak
-
由 Yves Senn 提交于
Adding subsection on 'Upgrading' guide about foreign key support [ci skip]
-
由 Zachary Scott 提交于
Fix some typos in railties/lib/rails/engine.rb [ci-skip]
-
由 RobertZK 提交于
-
由 Arthur Nogueira Neves 提交于
Fix typo in Rails::Application#migration_railties documentation [ci-skip]
-
由 RobertZK 提交于
-
由 Rafael Mendonça França 提交于
Use keyword argument in `transaction`
-
由 Ryuta Kamizono 提交于
This is no longer needed.
-
由 Ryuta Kamizono 提交于
The keys are already validated, so it is better to use the built-in feature to do this.
-
由 Ryuta Kamizono 提交于
`quote_default_expression` and `quote_default_value` are almost the same handling for do not quote default function of `:uuid` columns. Rename `quote_default_value` to `quote_default_expression`, and remove duplicate code.
-
由 claudiob 提交于
The methods `fresh_when` and `stale?` from ActionController::ConditionalGet accept a single record as a short form for a hash. For instance ```ruby def show @article = Article.find(params[:id]) fresh_when(@article) end ``` is just a short form for: ```ruby def show @article = Article.find(params[:id]) fresh_when(etag: @article, last_modified: @article.created_at) end ``` This commit extends `fresh_when` and `stale?` to also accept a collection of records, so that a short form similar to the one above can be used in an `index` action. After this commit, the following code: ```ruby def index @article = Article.all fresh_when(etag: @articles, last_modified: @articles.maximum(:created_at)) end ``` can be simply written as: ```ruby def index @article = Article.all fresh_when(@articles) end ```
-
由 Rafael Mendonça França 提交于
Fix wrong kwarg "record" from #18872
-
由 claudiob 提交于
PR #18772 changed the parameters of `stale?` to use `kwargs`. [As for this comment](https://github.com/rails/rails/pull/18872/files#r24456288) the default value for the `etag` parameter should be `record`, not `nil`. This commit fixes the code and introduces a test that: - passed before #18872 - fails on the current master (after #18772) - passes again after setting the default value of `etag` to `record`.
-
由 Ryuta Kamizono 提交于
`precision: 0` was not dumped by f1a0fa9e. However, `precision: 0` is valid value for PostgreSQL timestamps.
-
由 Andrey Nering 提交于
-
由 Arthur Nogueira Neves 提交于
Convert stale? and fresh_when to use keyword arguments.
-
由 Kasper Timm Hansen 提交于
-
由 Arthur Neves 提交于
-
由 Sean Griffin 提交于
Like for real this time. I checked.
-
由 Rafael Mendonça França 提交于
Fixed typos in ActiveRecord CHANGELOG [ci skip]
-
由 Rafael Mendonça França 提交于
Add an option `end` to `find_in_batches`
-
由 Prathamesh Sonpatki 提交于
-
由 Sean Griffin 提交于
-