aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | Merge pull request #36006 from prathamesh-sonpatki/rm-unused-requireRyuta Kamizono2019-04-171-1/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Removed unused require for active_support/deprecation
| * | | | | | | Removed unused require for active_support/deprecationPrathamesh Sonpatki2019-04-171-1/+0
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | - Unused since https://github.com/rails/rails/commit/a91ea1d51048342d13f
* | | | | | | Merge pull request #35987 from kamipo/fix_dirty_tracking_after_rollbackRyuta Kamizono2019-04-179-25/+92
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix dirty tracking after rollback.
| * | | | | | | Fix dirty tracking after rollback.Ryuta Kamizono2019-04-169-25/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the rollback only restores primary key value, `new_record?`, `destroyed?`, and `frozen?`. Since the `save` clears current dirty attribute states, retrying save after rollback will causes no change saved if partial writes is enabled (by default). This makes `remember_transaction_record_state` remembers original values then restores dirty attribute states after rollback. Fixes #15018. Fixes #30167. Fixes #33868. Fixes #33443. Closes #33444. Closes #34504.
* | | | | | | | Prefer to indent and no blank line after private/protected [ci skip]Ryuta Kamizono2019-04-171-1/+1
| | | | | | | |
* | | | | | | | Merge pull request #35984 from vishaltelangre/asn-misc-fixesJeremy Daer2019-04-163-10/+18
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Various fixes in ActiveSupport::Notifications::Event
| * | | | | | | | Add test coverageVishal Telangre2019-04-161-4/+13
| | | | | | | | |
| * | | | | | | | Remove @duration instance variable since we're not maintaining instances ↵Vishal Telangre2019-04-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variables such as @cpu_time, @idle_time and @allocations; this reduces one allocation
| * | | | | | | | Use monotonic time to record `started` and `finished` time values for an ↵Vishal Telangre2019-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | event subscribed by a `ActiveSupport::Notifications::Fanout::Subscribers::Timed` subscriber
| * | | | | | | | Fix: #cpu_time doesn't work for a ↵Vishal Telangre2019-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ActiveSupport::Notifications::Fanout::Subscribers::Timed` subscriber
* | | | | | | | | [ci skip] More asset guide touch upsKasper Timm Hansen2019-04-171-4/+5
| | | | | | | | |
* | | | | | | | | Merge pull request #35994 from ↵Kasper Timm Hansen2019-04-171-14/+6
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | soartec-lab/update_guide_asset_pipeline_change_default Guide updated in line with changes in rails commands [skip ci]
| * | | | | | | | | Guide updated in line with changes in rails commands [skip ci]soartec-lab2019-04-161-14/+6
| | | | | | | | | |
* | | | | | | | | | Only retry tests on CIKasper Timm Hansen2019-04-171-1/+3
| | | | | | | | | |
* | | | | | | | | | Fix bin/update references after 8927eba83cKasper Timm Hansen2019-04-173-10/+1
| | | | | | | | | |
* | | | | | | | | | Merge pull request #33139 'bin-idempotent-setup'Kasper Timm Hansen2019-04-173-50/+14
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Kasper Timm Hansen <kaspth@gmail.com>
| * | | | | | | | | | Factorize bin/update in bin/setup, and make bin/setup idempotentDavid Stosik2019-04-173-50/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `bin/setup` and `bin/update` are currently almost the same file. The only thing that keeps them apart is that one is running `bin/rails db:setup` and the other `bin/rails db:migrate`. I'm suggesting here that they should be a unique script, which needs to be idempotent. - New to a project, need to get started? `bin/setup` - Need to install new dependencies that were added recently? `bin/setup`. Before deprecating `bin/update`, I'm suggesting we just have it call `bin/setup`.
| * | | | | | | | | | Merge branch 'collection-cache-versioning'Kasper Timm Hansen2019-04-165-15/+93
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Kasper Timm Hansen <kaspth@gmail.com>
* | \ \ \ \ \ \ \ \ \ \ Merge pull request #34378 'collection-cache-versioning'Kasper Timm Hansen2019-04-165-15/+93
|\ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / |/| / / / / / / / / / / | |/ / / / / / / / / / Signed-off-by: Kasper Timm Hansen <kaspth@gmail.com>
| * / / / / / / / / / Add collection cache versioningLachlan Sylvester2019-04-165-15/+93
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cache versioning enables the same cache key to be reused when the object being cached changes by moving the volatile part of the cache key out of the cache key and into a version that is embedded in the cache entry. This is already occurring when the object being cached is an `ActiveRecord::Base`, but when caching an `ActiveRecord::Relation` we are currently still putting the volatile information (max updated at and count) as part of the cache key. This PR moves the volatile part of the relations `cache_key` into the `cache_version` to support recycling cache keys for `ActiveRecord::Relation`s.
* | | | | | | | | | running test with_info_handler methodMauri Mustonen2019-04-162-1/+8
| | | | | | | | | |
* | | | | | | | | | Merge pull request #35997 from ↵Rafael França2019-04-162-2/+12
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tjoyal/Rails/MailersController/do-not-leak-I18n-global-setting-changes [Rails::MailersController] Do not leak I18n global setting changes
| * | | | | | | | | | [Rails::MailersController] Do not leak I18n global setting changesThierry Joyal2019-04-162-2/+12
| | | | | | | | | | |
* | | | | | | | | | | Merge pull request #35996 from utilum/warning_useless_useKasper Timm Hansen2019-04-161-2/+2
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | | Squash warning: possibly useless use of a constant in void context
| * | | | | | | | | | Squash warning: possibly useless use of a constantutilum2019-04-161-2/+2
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in void context
* | | | | | | | | | Merge pull request #35995 from soartec-lab/update_guide_command_line_sample_codeEileen M. Uchitelle2019-04-161-6/+5
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Update the generate command sample codes [skip ci]
| * | | | | | | | | | Update the generate command sample codes [skip ci]soartec-lab2019-04-171-6/+5
|/ / / / / / / / / /
* | | | | | | | | | Merge pull request #35946 from alimi/cache-full-mysql-database-versionKasper Timm Hansen2019-04-164-5/+18
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Cache full MySQL version in schema cache
| * | | | | | | | | | Make changes per PR feedbackAli Ibrahim2019-04-122-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove AbstractMysqlAdapter::Version since full_version_string will always be set. * Remove nodoc on private methods because private methods are not exposed in the docs.
| * | | | | | | | | | Cache full MySQL version in schema cacheAli Ibrahim2019-04-114-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The database version is cached in all the adapters, but this didn't include the full MySQL version. Anything that uses the full MySQL version would need to query the database to get that data even if they're using the schema cache. * Now the full MySQL version will be cached in the schema cache via the Version object.
* | | | | | | | | | | Merge pull request #35985 from jhawthorn/lazy_backtrace_cleanKasper Timm Hansen2019-04-163-2/+16
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | | Find query_source_location using lazy Enumerator
| * | | | | | | | | | Find query_source_location using lazy EnumeratorJohn Hawthorn2019-04-153-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way, we only need to filter the backtrace up to the first non-noise stack frame. This also updates noise to be able to deal with being passed a lazy enum. We don't need this anywhere, but it seemed better for this to be consistent.
* | | | | | | | | | | Merge pull request #35989 from koic/bump_rubocop_to_0_67_2Ryuta Kamizono2019-04-166-6/+14
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Bump RuboCop to 0.67.2
| * | | | | | | | | | | Bump RuboCop to 0.67.2Koichi ITO2019-04-166-6/+14
| | |_|_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance cops will be extracted from RuboCop to RuboCop Performance when next RuboCop 0.68 will be released. https://github.com/rubocop-hq/rubocop/issues/5977 RuboCop 0.67 is its transition period. Since rails/rails repository uses Performance cops, This PR added rubocop-performance gem to Gemfile. And this PR fixes some offenses using the following auto-correct. ```console % bundle exec rubocop -a Offenses: activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:212:26: C: [Corrected] Layout/SpaceAroundOperators: Operator = > should be surrounded by a single space. "primary" => { adapter: "sqlite3", database: "db/primary.sqlite3" } ^^ activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:239:26: C: [Corrected] Layout/SpaceAroundOperators: Operator => should be surrounded by a single space. "primary" => { adapter: "sqlite3", database: "db/primary.sqlite3" } ^^ actionview/test/template/resolver_shared_tests.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true. module ResolverSharedTests ^ actionview/test/template/resolver_shared_tests.rb:10:33: C: [Corrected] Layout/SpaceAroundEqualsInParameterDefault: Surrounding space missing in default value assignment. def with_file(filename, source="File at #{filename}") ^ actionview/test/template/resolver_shared_tests.rb:106:5: C: [Corrected] Rails/RefuteMethods: Prefer assert_not_same over refute_same. refute_same a, b ^^^^^^^^^^^ 2760 files inspected, 5 offenses detected, 5 offenses corrected ```
* | | | | | | | | | | Merge pull request #35988 from sharang-d/format-documentationRyuta Kamizono2019-04-161-2/+2
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | | Format a comment to not show up as code [ci skip]
| * | | | | | | | | | Format a comment to not show up as code [ci skip]Sharang Dashputre2019-04-161-2/+2
|/ / / / / / / / / /
* | | | | | | | | | Add CHANGELOG entry for d1107f4d1e2573948d4941ac44511a0af6241f80Ryuta Kamizono2019-04-161-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | | | | Merge pull request #35962 from y-yagi/migrate_config_file_to_new_settingsYuji Yaginuma2019-04-161-6/+4
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Migrate Code Climate config file to new configuration
| * | | | | | | | | | Migrate Code Climate config file to new configurationyuuji.yaginuma2019-04-161-6/+4
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't know whether have to move to a new configuration, but I think there is no need to keep using the old configuration. Ref: https://docs.codeclimate.com/docs/advanced-configuration#section-analysis-configuration-versions
* / / / / / / / / / Don't refer `@transaction_state` directlyRyuta Kamizono2019-04-161-5/+5
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 8180c39, remaining transaction state is cleared in `force_clear_transaction_record_state` to less work `sync_with_transaction_state`. But it caused a race condition that `@transaction_state` would be cleared by other threads if the state is finalized. To work as before, snapshot `@transaction_state` to local variable not to refer `@transaction_state` directly. Fixes #35983.
* | | | | | | | | Merge pull request #35975 from xithan/masterRafael França2019-04-153-12/+22
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | mounted routes with non-word characters
| * | | | | | | | | mounted routes with non-word charactersxithan2019-04-153-12/+22
| | | | | | | | | |
* | | | | | | | | | Merge pull request #35977 from prathamesh-sonpatki/rm-required-in-generatorsRafael França2019-04-152-14/+3
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Remove `required: true` from the model generator template
| * | | | | | | | | | Remove `required: true` from the model generator templatePrathamesh Sonpatki2019-04-152-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `belongs_to` association have `required: true` by default https://github.com/rails/rails/pull/18937 onwards so we don't need it in the generator template. We still need the code for required in the command line generator as it adds `null: false` in the migration.
* | | | | | | | | | | Merge pull request #35959 from jhawthorn/unbound_templatesRafael França2019-04-157-14/+237
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | De-duplicate templates, introduce UnboundTemplate
| * | | | | | | | | | | Add additional test for sharing templatesJohn Hawthorn2019-04-121-1/+18
| | | | | | | | | | | |
| * | | | | | | | | | | Avoid duplication using _find_allJohn Hawthorn2019-04-121-11/+7
| | | | | | | | | | | |
| * | | | | | | | | | | Support disabling cache for DigestorJohn Hawthorn2019-04-123-22/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a bit of complexity, but is necessary for now to avoid holding extra copies of templates which are resolved from ActionView::Digestor after disabling cache on the lookup context.
| * | | | | | | | | | | De-dup Templates, introduce UnboundTemplateJohn Hawthorn2019-04-124-10/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it's possible to have multiple copies of the "same" Template. For example, if index.html.erb is found both the :en and :fr locale, it will return a different Template object for each. The same can happen with formats, variants, and handlers. This commit de-duplicates templates, there will now only be one template per file/virtual_path/locals tuple. We need to consider virtual_path because both `render "index"`, and `render "index.html"` can both find the same file but will have different virtual_paths. IMO this is rare and should be deprecated/removed, but it exists now so we need to consider it in order to cache correctly. This commit introduces a new UnboundTemplate class, which represents a template with unknown locals. Template objects can be built from it by using `#with_locals`. Currently, this is just a convenience around caching templates, but I hope it's a helpful concept that could have more utility in the future.
| * | | | | | | | | | | Add tests against resolverJohn Hawthorn2019-04-113-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We didn't previously have many tests directly against the OptimizedFileSystemResolver or FileSystemResolver, though usually failures would be exposed through other tests. It's easier to test some specifics of the behaviour with unit tests. This also lets us test FileSystemResolver (non-optimized) which I don't think previously had much testing (other than from classses inheriting it).