aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #33217 from eugeneius/test_duration_preserve_partsRyuta Kamizono2018-06-281-0/+12
|\ | | | | Add tests for duration multiplication and division
| * Add tests for duration multiplication and divisionEugene Kenny2018-06-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | When multiplying or dividing a duration by a scalar, it's tempting to operate directly on the duration's value in seconds and recompute the parts from the result. However this loses information, as there are multiple combinations of parts that map to any given number of seconds (e.g. `2.weeks` or `336.hours`). This is especially problematic when dealing with durations on the scale of months or years, as converting an exact number of seconds to one of those intervals and then using the resulting duration to modify a date will give the wrong result.
* | Merge pull request #33234 from alpaca-tc/autoload_activejob_argumentsRyuta Kamizono2018-06-273-3/+1
|\ \ | | | | | | Autoload Activejob::Arguments
| * | Autoload ActiveJob::Argumentsalpaca-tc2018-06-271-0/+1
| | |
| * | ActiveJob::Arguments is no longer used in filealpaca-tc2018-06-272-3/+0
|/ /
* | Merge pull request #33230 from bogdanvlviv/add-changelog-entry-for-3110caecPrem Sichanugrist2018-06-271-0/+4
|\ \ | | | | | | | | | | | | Add changelog entry for allow passing multiple exceptions to retry_on/discard_on (3110cae) [ci skip]
| * | Add changelog entry for 3110cae [ci skip]bogdanvlviv2018-06-271-0/+4
|/ / | | | | | | | | | | | | Since it is changes of the public API, it seems valuable to add a mention about it to the changelog file. Follow up 3110caecbebdad7300daaf26bfdff39efda99e25
* | Merge pull request #33223 from rails/homogeneous-allocationAaron Patterson2018-06-265-2/+49
|\ \ | | | | | | Speed up homogeneous AR lists / reduce allocations
| * | Fix documentation based on feedbackAaron Patterson2018-06-262-3/+7
| | |
| * | define attribute methods in `init_from_db`Aaron Patterson2018-06-261-0/+2
| | | | | | | | | | | | | | | Now that `allocate` is removed, we need to define attribute methods in all "init" methods.
| * | Merge branch 'master' into homogeneous-allocationAaron Patterson2018-06-2610-40/+27
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Call initialize after allocate Remove `ActiveSupport::Concern` from `ActiveRecord::Aggregations` Add example for no_touching? in active_record/no_touching for api docs [ci skip] Generate a new key for each service test
| * | | Speed up homogeneous AR lists / reduce allocationsAaron Patterson2018-06-255-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit speeds up allocating homogeneous lists of AR objects. We can know if the result set contains an STI column before initializing every AR object, so this change pulls the "does this result set contain an STI column?" test up, then uses a specialized instantiation function. This way we only have to check for an STI column once rather than N times. This change also introduces a new initialization function that is meant for use when allocating AR objects that come from the database. Doing this allows us to eliminate one hash allocation per AR instance. Here is a benchmark: ```ruby require 'active_record' require 'benchmark/ips' ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:" ActiveRecord::Migration.verbose = false ActiveRecord::Schema.define do create_table :users, force: true do |t| t.string :name t.timestamps null: false end end class User < ActiveRecord::Base; end 2000.times do User.create!(name: "Gorby") end Benchmark.ips do |x| x.report("find") do User.limit(2000).to_a end end ``` Results: Before: ``` [aaron@TC activerecord (master)]$ be ruby -I lib:~/git/allocation_tracer/lib speed.rb Warming up -------------------------------------- find 5.000 i/100ms Calculating ------------------------------------- find 56.192 (± 3.6%) i/s - 285.000 in 5.080940s ``` After: ``` [aaron@TC activerecord (homogeneous-allocation)]$ be ruby -I lib:~/git/allocation_tracer/lib speed.rb Warming up -------------------------------------- find 7.000 i/100ms Calculating ------------------------------------- find 72.204 (± 2.8%) i/s - 364.000 in 5.044592s ```
* | | | Merge pull request #33225 from utilum/railties_testoptsRafael França2018-06-261-1/+1
|\ \ \ \ | |_|/ / |/| | | Enable TESTOPTS in railties tests
| * | | Enable TESTOPTS in railties testsutilum2018-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike the other components' test suites, railties' currently ignores such useful options as `"--verbose"` or `"--name"`. This patch allows us to use them.
* | | | Merge pull request #33227 from rails/remove-allocateAaron Patterson2018-06-262-18/+0
|\ \ \ \ | |/ / / |/| | | Call initialize after allocate
| * | | Call initialize after allocateAaron Patterson2018-06-262-18/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | If someone calls allocate on the object, they'd better also call an initialization routine too (you can't expect allocate to do any initialization work). Before this commit, AR objects that are instantiated from the database would call `define_attribute_methods` twice.
* | | Remove `ActiveSupport::Concern` from `ActiveRecord::Aggregations`Ryuta Kamizono2018-06-261-2/+0
| | | | | | | | | | | | | | | `include Aggregations` no longer needs to invoke `extend Aggregations::ClassMethods` since 657060b.
* | | Merge pull request #33224 from mikepmunroe/mm-no-touching-api-updateRyuta Kamizono2018-06-261-0/+7
|\ \ \ | | | | | | | | Add example for no_touching? for api docs [ci skip]
| * | | Add example for no_touching? in active_record/no_touching for api docs [ci skip]Michael Munroe2018-06-251-0/+7
|/ / / | | | | | | | | | | | | There was no example code for ActiveRecord::NoTouching#no_touching?. This PR adds an example for the API docs.
* / / Generate a new key for each service testGeorge Claghorn2018-06-256-20/+20
|/ / | | | | | | Sidestep Google Cloud Storage's restrictive per-object rate limit.
* | Merge pull request #33221 from rails/lazy-aggregateAaron Patterson2018-06-252-1/+5
|\ \ | | | | | | Lazily add `Aggregations` to `composed_of` models
| * | Lazily add `Aggregations` to `composed_of` modelsAaron Patterson2018-06-252-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | `composed_of` is a fairly rare method to call on models. This commit adds the `Aggregations` module to models that call `composed_of` so that models that *don't* call `composed_of` don't need to instantiate the `aggregation_cache` hash. This saves one hash allocation per model instance that doesn't use `composed_of`
* | | Allow passing multiple exceptions to retry_on/discard_onGeorge Claghorn2018-06-253-7/+32
|/ /
* | `references(:developers_projects_join)` isn't needed if using `where` with ↵Ryuta Kamizono2018-06-261-16/+2
| | | | | | | | hash condition
* | Use `reflection.alias_candidate` in `table_alias_for`Ryuta Kamizono2018-06-261-1/+1
|/ | | | | | | | | | | | | | | The "join" affix in `table_alias_for` was added 12 years ago at 02d3444 to address poor alias tracking. `AssociationScope` no longer uses the "join" suffixed alias since 0408e21 and had been removed at a1ec8b5. `table_alias_for` is the last place that using the useless legacy suffixed alias, but we can't remove the suffix since some test cases directly refers the alias name by `where` with string literal, so at least removing the suffix would break our test cases. (e.g. https://github.com/rails/rails/blob/b2eb1d1c55a59fee1e6c4cba7030d8ceb524267c/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb#L699-L731).
* Revert "Avoid Node.js v10.4.0 for now"yuuji.yaginuma2018-06-251-1/+1
| | | | | | | This reverts commit 691addbffad10aa249d5fb1b0e47b46a086e5332. Reason: v10.5.0 has been released, and it seems that the issue is fixed. Ref: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V10.md#10.5.0
* Merge pull request #33191 from ↵George Claghorn2018-06-241-1/+1
|\ | | | | | | | | bogdanvlviv/change-rails_welcome-image-on-localhost3000 Changes Rails Welcome image on localhost:3000
| * Changes Rails Welcome image on localhost:3000bogdanvlviv2018-06-221-1/+1
| | | | | | | | | | | | | | | | | | Note that I used https://www.base64-image.de/ in order to convert the image to Base64 with enabled optimization status. Closes #33181. Closes #33186. Follow up #32735.
* | Add an assertion that `credentials:edit` works when `RAILS_MASTER_KEY` env ↵yuuji.yaginuma2018-06-241-1/+1
| | | | | | | | is specified
* | Merge pull request #33205 from ishanray/patch-1Ryuta Kamizono2018-06-241-1/+1
|\ \ | | | | | | | | | | | | Update service.rb [ci skip]
| * | Update service.rbishanray2018-06-241-1/+1
|/ /
* | Fix formatting of `primary_key` [ci skip]yuuji.yaginuma2018-06-241-2/+2
| |
* | Merge pull request #33204 from utilum/bump_raabroYuji Yaginuma2018-06-241-1/+1
|\ \ | | | | | | Update raabro to latest version
| * | Update raabro to latest versionutilum2018-06-231-1/+1
|/ / | | | | | | [v 1.1.6](https://github.com/floraison/raabro/blob/master/CHANGELOG.md#raabro-116--released-2018-06-22) fixes a warning we see on [Rails CI](https://travis-ci.org/rails/rails/jobs/395177524#L3763).
* | OS X -> macOS [Closes #30313]Xavier Noria2018-06-234-6/+6
| | | | | | | | [Jon Moss & Xavier Noria]
* | Merge pull request #33198 from henrik/patch-1George Claghorn2018-06-221-1/+5
|\ \ | |/ |/| Active Storage: Explicit form field in basic example
| * Active Storage: Explicit form field in basic exampleHenrik Nyh2018-06-221-1/+5
|/ | | Also fix syntax highlighting in the more advanced JS example.
* Merge pull request #33184 from ↵Prem Sichanugrist2018-06-221-0/+4
|\ | | | | | | | | bogdanvlviv/document-year_format-option-of-date_select Add to docs mention about `:year_format` option of date select
| * Add to docs mention about `:year_format` option of date selectbogdanvlviv2018-06-221-0/+4
|/ | | | | | Follow up #32190 [ci skip]
* Add missing test case for `find` with a large numberRyuta Kamizono2018-06-221-0/+6
|
* Permit configuring the default service URL expiryGeorge Claghorn2018-06-219-10/+17
|
* Merge pull request #33176 from utilum/bump_fugitYuji Yaginuma2018-06-211-2/+2
|\ | | | | Update fugit to latest version
| * Update fugit to latest versionutilum2018-06-211-2/+2
|/ | | | | | | [fugit 1.1.3](https://github.com/floraison/fugit/commit/03a3ee86f3cd5d929442dd25896b99acbd151947) fixes warnings that show up in ActiveJob tests. See [CI](https://travis-ci.org/rails/rails/jobs/394107740#L3764-L3778).
* Merge pull request #32190 from liwii/use_year_namesRyuta Kamizono2018-06-213-1/+71
|\ | | | | | | Add `use_year_names` option to date_select tag
| * Add `year_format` option to date_select tag. This option makes it possible ↵Koki Ryu2018-06-103-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to customize year names. Lambda should be passed to use this option. Example: date_select('user_birthday', '', start_year: 1998, end_year: 2000, year_format: ->year { "Heisei #{year - 1988}" }) The HTML produced: <select id="user_birthday__1i" name="user_birthday[(1i)]"> <option value="1998">Heisei 10</option> <option value="1999">Heisei 11</option> <option value="2000">Heisei 12</option> </select> /* The rest is omitted */
* | Merge pull request #33175 from gsamokovarov/fix-actionpack-typoRyuta Kamizono2018-06-211-1/+1
|\ \ | | | | | | | | | | | | Fix actionpack changelog typo [ci skip]
| * | Fix a typo in the Action Pack changelog [ci skip]Genadi Samokovarov2018-06-191-1/+1
| | | | | | | | | | | | I spotted it while working on a PR.
* | | Merge pull request #33172 from ↵Yuji Yaginuma2018-06-211-0/+2
|\ \ \ | | | | | | | | | | | | | | | | thomasdziedzic-pd/add-use_authenticated_message_encryption-documentation add documentation for config.active_support.use_authenticated_message_encryption
| * | | add documentation for ↵Thomas Dziedzic2018-06-201-0/+2
|/ / / | | | | | | | | | | | | | | | config.active_support.use_authenticated_message_encryption [ci skip] related to https://github.com/rails/rails/issues/33170
* | | Remove all `aliases` passing from `JoinDependency`Ryuta Kamizono2018-06-201-2/+2
| | | | | | | | | | | | Follow up of 15367a2c674bf19eeefa12ccb64391bdd50d883d.