aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | | Remove erroneous remove_column option from exampleGeorge Semenov2018-06-291-1/+1
| |/ / / / / / / / /
* | | | | | | | | | Merge pull request #33264 from huacnlee/fix-redis-incr-ttl-checkRyuta Kamizono2018-06-302-6/+22
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | Fix Cache :redis_store increment/decrement ttl check and add more tests.
| * | | | | | | | | Fix Cache :redis_store increment/decrement ttl check and add more tests.Jason Lee2018-06-302-6/+22
|/ / / / / / / / /
* | | | | | | | | Merge pull request #33260 from bogdanvlviv/fix-docs-of-assert_no_emailsRafael França2018-06-291-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix docs of `assert_no_emails` [ci skip]
| * | | | | | | | | Fix docs of `assert_no_emails` [ci skip]bogdanvlviv2018-06-291-1/+1
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | `assert_no_emails` is shortcut for `assert_emails 0, &block`.
* | | | | | | | | Merge pull request #33258 from ↵Rafael França2018-06-295-16/+160
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bogdanvlviv/allow-callassert_enqueued_with-with-no-block Allow call `assert_enqueued_with` and `assert_enqueued_email_with` with no block
| * | | | | | | | | Allow call `assert_enqueued_with` and `assert_enqueued_email_with` with no blockbogdanvlviv2018-06-295-16/+160
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example of `assert_enqueued_with` with no block ```ruby def test_assert_enqueued_with MyJob.perform_later(1,2,3) assert_enqueued_with(job: MyJob, args: [1,2,3], queue: 'low') MyJob.set(wait_until: Date.tomorrow.noon).perform_later assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon) end ``` Example of `assert_enqueued_email_with` with no block: ```ruby def test_email ContactMailer.welcome.deliver_later assert_enqueued_email_with ContactMailer, :welcome end def test_email_with_arguments ContactMailer.welcome("Hello", "Goodbye").deliver_later assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"] end ``` Related to #33243
* | | | | | | | | Merge pull request #33238 from ↵Rafael França2018-06-291-0/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dikond/explicit_action_mailer_deliver_later_queue_name Note deliver_later_queue_name gotcha in ActionMailer guide
| * | | | | | | | | Note deliver_later_queue_name gotcha in ActionMailer guide [ci skip]dikond2018-06-271-0/+2
| | | | | | | | | |
* | | | | | | | | | Merge pull request #33255 from StanBoyet/patch-1Rafael França2018-06-291-0/+2
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Incompatibility of Direct Uploads & Mirror Service
| * | | | | | | | | | Incompatibility of Direct Uploads & Mirror ServiceStanislas Boyet2018-06-291-0/+2
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] It adds a note to the Active Storage documentation regarding the use of Mirror Service not being compatible with the use of the Direct Uploads as described later on in the documentation, as described in issue #32732
* | | | | | | | | | Merge pull request #33254 from ↵Rafael França2018-06-293-2/+57
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | huacnlee/add-expires-in-option-support-for-redis-cache-store-increment-method Add :expires_in option support for RedisCacheStore increment/decrement method
| * | | | | | | | | | Add :expires_in option support for RedisCacheStore increment/decrement method.Jason Lee2018-06-293-2/+57
| | | | | | | | | | |
* | | | | | | | | | | Merge pull request #33250 from utilum/pdftoppm_existsMatthew Draper2018-06-291-1/+1
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | | Refactor Previewer::PopplerPDFPreviewer#pdftoppm_exists?
| * | | | | | | | | | Tweak Previewer::PopplerPDFPreviewer#pdftoppm_exists?utilum2018-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Does not warn `instance variable @pdftoppm_exists not initialized`.
* | | | | | | | | | | Merge pull request #33246 from anthonycrumley/improve-form-with-wordingRafael França2018-06-281-4/+5
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Improve wording for form_with in Getting Started Guide
| * | | | | | | | | | | Improve wording for form_with in Getting Started GuideAnthony Crumley2018-06-281-4/+5
| |/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] Improved wording by making it clear the form_with helper method was being referenced in the first paragraph and that the second paragraph is a continuation of the form_with train of thought. Additionally, a connection was made to examples of the form_with usage being described.
* / / / / / / / / / / Revert "Merge pull request #33243 from ↵Rafael Mendonça França2018-06-281-1/+1
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | evopark/fix/action-mailer-test-helper-no-block" This reverts commit 9d6bbf4e0b2d2b2e2fccd87a778de2893bb28a25, reversing changes made to 5a1ea09062eaed78e21253a128d433a1beb745ad. This method only works with block.
* | | | | | | | | | Merge pull request #26764 from choncou/improve_has_secure_passwordRafael Mendonça França2018-06-284-56/+72
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow configurable attribute name on `#has_secure_password`
| * | | | | | | | | | Remove method for regenerating a token, and update `#authenticate`.Unathi Chonco2016-10-123-61/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change now creates a method `#authenticate_XXX` where XXX is the configured attribute name on `#has_secure_password`. `#authenticate` is now an alias to this method when the attribute name is the default 'password'
| * | | | | | | | | | This addition will now allow configuring an attribute name for theUnathi Chonco2016-10-124-41/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | existing `#has_secure_password`. This can be useful when one would like to store some secure field as a digest, just like a password. The method still defaults to `password`. It now also allows using the same `#authenticate` method which now accepts a second argument for specifying the attribute to be authenticated, or will default to 'password`. A new method is also added for generating a new token for an attribute by calling `#regenerate_XXXX` where `XXXX` is the attribute name.
* | | | | | | | | | | Merge pull request #33244 from utilum/guides_menu_breakdownRafael França2018-06-281-9/+13
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Break guides menu 'Digging Deeper' section in two
| * | | | | | | | | | | Break guides menu 'Digging Deeper' section in twoutilum2018-06-281-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This list in the menu is currently long, and the order of the items not immediately obvious. I often find my self rescanning to find what I'm looking for, so I imagine that others do to.
* | | | | | | | | | | | Merge pull request #33243 from evopark/fix/action-mailer-test-helper-no-blockRafael França2018-06-281-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / |/| | | | | | | | | | | Fix ActionMailer assert_enqueued_email_with
| * | | | | | | | | | | Fix ActionMailer assert_enqueued_email_withMarcus Ilgner2018-06-281-1/+1
|/ / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for assert_enqueued_email_with states that it's supposed to work without a block yet it calls assert_enqueued_with which doesn't check whether a block was passed before calling `yield`
* | | | | | | | | | | 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).