aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bumps Zeitwerk and BootsnapXavier Noria2019-03-265-13/+16
|
* Remove useless = [ci skip]Prathamesh Sonpatki2019-03-261-1/+1
|
* Merge pull request #31442 from ebeigarts/weak_descendants_trackerMatthew Draper2019-03-273-4/+64
|\ | | | | Use weak references in descendants tracker
| * Use weak references in descendants trackerEdgars Beigarts2019-03-263-4/+64
| | | | | | | | It allows anonymous subclasses to be garbage collected.
* | Merge pull request #35756 from sergioro9/patch-1Xavier Noria2019-03-261-1/+1
|\ \ | | | | | | Grammar error
| * | Spelling errorSergio2019-03-261-1/+1
|/ /
* | Merge pull request #35743 from ↵Vipul A M2019-03-261-1/+1
|\ \ | | | | | | | | | | | | soartec-lab/update_guide_active_support_deprecation_silenced Add default value `ActiveSupport::Deprecation.silenced` [ci skip]
| * | Add default value `ActiveSupport::Deprecation.silenced` [ci skip]soartec-lab2019-03-251-1/+1
| |/
* | Fix CI failure due to remaining tagging recordsRyuta Kamizono2019-03-261-1/+1
| | | | | | | | | | | | | | | | | | `TRUNCATE TABLE posts` also resets `AUTO_INCREMENT`. If newly created a post, it is wrongly associated with remaining tagging records. To un-associate remaining tagging record, use `post.create_tagging!` instead. Fixes #35751.
* | Merge pull request #35754 from yahonda/diag35665Ryuta Kamizono2019-03-261-1/+1
|\ \ | |/ |/| Use `assert_queries(0)` instead of `assert_no_queries`
| * Use `assert_queries(0)` instead of `assert_no_queries` to ignore metadata ↵Yasuo Honda2019-03-261-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | queries Fix #35665 ```ruby $ ARCONN=mysql2 bin/test test/cases/scoping/named_scoping_test.rb test/cases/tasks/database_tasks_test.rb test/cases/associations/cascaded_eager_loading_test.rb test/cases/associations/eager_singularization_test.rb -n "/^(?:NamedScopingTest#(?:test_many_should_not_fire_query_if_scope_loaded)|ActiveRecord::DatabaseTasksDumpSchemaCacheTest#(?:test_dump_schema_cache)|CascadedEagerLoadingTest#(?:test_eager_association_loading_with_has_many_sti_and_subclasses)|EagerSingularizationTest#(?:test_eager_no_extra_singularization_has_many_through_belongs_to))$/" --seed 16818 Using mysql2 Run options: -n "/^(?:NamedScopingTest#(?:test_many_should_not_fire_query_if_scope_loaded)|ActiveRecord::DatabaseTasksDumpSchemaCacheTest#(?:test_dump_schema_cache)|CascadedEagerLoadingTest#(?:test_eager_association_loading_with_has_many_sti_and_subclasses)|EagerSingularizationTest#(?:test_eager_no_extra_singularization_has_many_through_belongs_to))$/" --seed 16818 ...F Failure: CascadedEagerLoadingTest#test_eager_association_loading_with_has_many_sti_and_subclasses [/home/yahonda/git/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb:124]: 1 instead of 0 queries were executed. Queries: SHOW FULL FIELDS FROM `topics`. Expected: 0 Actual: 1 bin/test test/cases/associations/cascaded_eager_loading_test.rb:119 Finished in 6.894609s, 0.5802 runs/s, 1.0153 assertions/s. 4 runs, 7 assertions, 1 failures, 0 errors, 0 skips $ ```
* Merge pull request #35740 from sharang-d/change-test-wordingRyuta Kamizono2019-03-251-4/+4
|\ | | | | Reword test names in credentials_test.rb
| * Reword test names in credentials_test.rbSharang Dashputre2019-03-251-4/+4
| |
* | Merge pull request #35741 from chiraggshah/patch-1Vipul A M2019-03-251-1/+1
|\ \ | | | | | | [ci skip] Fixed typo in CHANGELOG.md
| * | [ci skip] Fixed typoChirag Shah2019-03-251-1/+1
|/ /
* | Merge pull request #35739 from sharang-d/unique_by-changesVipul A M2019-03-251-3/+3
|\ \ | |/ |/| Format 'RETURNING' text in the docs [ci skip]
| * Format 'RETURNING' text in the docs [ci skip]Sharang Dashputre2019-03-251-3/+3
|/
* Cleanup guide for configuring config.disable_sandbox and related changelog ↵Vipul A M2019-03-252-3/+3
| | | | [ci skip] (#35733)
* Merge pull request #35732 from rails/webdriversGuillermo Iguaran2019-03-245-13/+13
|\ | | | | Replace chromedriver-helper with webdrivers
| * Use webdrivers instead of chromedriver-helper in new appsGuillermo Iguaran2019-03-242-4/+4
| |
| * Use webdrivers instead of chromedriver-helper for AV UJS testsGuillermo Iguaran2019-03-243-9/+9
| |
* | Merge pull request #35723 from sikachu/disable-sandbox-flagGuillermo Iguaran2019-03-247-5/+54
|\ \ | |/ |/| Add config.disable_sandbox option to Rails console
| * Add config.disable_sandbox option to Rails consolePrem Sichanugrist2019-03-237-5/+54
| | | | | | | | | | | | | | | | | | | | | | A long-running `rails console --sandbox` could cause a database server to become out-of-memory as it's holding on to changes that happen on the database. Given that it's common for Ruby on Rails application with huge traffic to have separate write database and read database, we should allow the developers to disable this sandbox option to prevent someone from accidentally causing the Denial-of-Service on their server.
* | Merge pull request #35690 from soartec-lab/update_guide_sending_log_messagesRyuta Kamizono2019-03-241-1/+1
|\ \ | | | | | | Add `unknown` method to list of methods to write current log [ci skip]
| * | Add `unknown` method to list of methods to write current log [ci skip]soartec-lab2019-03-211-1/+1
| | |
* | | Merge pull request #35724 from ↵Ryuta Kamizono2019-03-241-1/+1
|\ \ \ | | | | | | | | | | | | | | | | soartec-lab/update_guide_raise_on_missing_translations_default Add default `config.action_view.raise_on_missing_translations` [ci skip]
| * | | Add default `config.action_view.raise_on_missing_translations` [ci skip]soartec-lab2019-03-241-1/+1
| | | |
* | | | Merge pull request #35718 from ↵Yuji Yaginuma2019-03-242-2/+24
|\ \ \ \ | |/ / / |/| | | | | | | | | | | y-yagi/add_secret_key_base_when_creating_new_credentials Add `secret_key_base` when creating new credential file
| * | | Add `secret_key_base` when creating new credential fileyuuji.yaginuma2019-03-232-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since `secret_key_base` is expected to be included in credential file, `secret_key_base` should be included even if re-create the file. This is the same behavior as creating a new app. When env is specified, it may be unnecessary, so I added it only when not specifying env.
* | | | Avoid creating ActionText::RichText records unnecessarilyGeorge Claghorn2019-03-232-1/+9
| | | | | | | | | | | | | | | | Assigning a has_one association for a persisted record saves the change immediately, so attempting to read a rich-text attribute on a persisted record without a corresponding ActionText::RichText would eagerly create one. Avoid assigning the rich text association to fix.
* | | | Depend on Zeitwerk 1.4.2Xavier Noria2019-03-232-3/+3
| | | |
* | | | Merge pull request #35683 from Kukunin/masterRyuta Kamizono2019-03-232-7/+38
|\ \ \ \ | | | | | | | | | | Bugfix: Fix false autosave for has_one :through association
| * | | | Fix unintended autosave on has_one through associationSergiy Kukunin2019-03-222-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #35680 The problem occurred, when a `has one through` association contains a foreign key (it belongs to the intermediate association). For example, Comment belongs to Post, Post belongs to Author, and Author `has_one :first_comment, through: :first_post`. In this case, the value of the foreign key is comparing with the original record, and since they are likely different, the association is marked as changed. So it updates every time when the origin record updates.
* | | | | Merge pull request #35719 from shailesh-kalamkar/fix-change-log-typoRichard Schneeman2019-03-221-1/+1
|\ \ \ \ \ | | | | | | | | | | | | [ci skip] Fixed CHANGELOG typo
| * | | | | [ci skip] Fixed typoShailesh Kalamkar2019-03-231-1/+1
|/ / / / /
* | / / / Update comment for how secret key is calculatedJohn Hawthorn2019-03-221-1/+2
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | This updates the comment to reflect how the secret key is generated since 4c743587ad6a31908503ab317e37d70361d49e66 Fixes #35717
* | | | Merge pull request #35713 from gmcgibbon/drop_nsec_in_job_argument_assertionsGannon McGibbon2019-03-223-0/+73
|\ \ \ \ | | | | | | | | | | Drop microseconds in job argument assertions
| * | | | Drop microseconds in job argument assertionsGannon McGibbon2019-03-223-0/+73
| | | | |
* | | | | Merge pull request #35715 from jhawthorn/changelog_for_cves_6_0John Hawthorn2019-03-222-2/+21
|\ \ \ \ \ | | | | | | | | | | | | Update CHANGELOGs for 6.0.0.beta3 release
| * | | | | Update CHANGELOGs for 6.0.0.beta3 releaseJohn Hawthorn2019-03-222-2/+21
| | | | | |
* | | | | | Merge pull request #35710 from alimi/as-changelog-typoJohn Hawthorn2019-03-221-1/+1
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Fix AS CHANGELOG typo
| * | | | | Fix AS CHANGELOG typoAli Ibrahim2019-03-221-1/+1
|/ / / / /
* | | | | Merge pull request #35707 from ↵Rafael França2019-03-221-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | localhostdotdev/fix-rails-guides-generation-invalid-formats-html Fix rails guides generation
| * | | | | Fix rails guides generationlocalhostdotdev2019-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Was getting `formats=': Invalid formats: "html"
* | | | | | Merge pull request #35705 from alimi/instrumenter-block-optionalEileen M. Uchitelle2019-03-224-4/+29
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Update AS::Notifications::Instrumenter#instrument
| * | | | | Update instrumentation guides w/optional blockAli Ibrahim2019-03-221-0/+11
| | | | | |
| * | | | | Update CHANGELOG and docsAli Ibrahim2019-03-222-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | with change to ActiveSupport::Notifications::Instrumenter#instrument
| * | | | | Update AS::Notifications::Instrumenter#instrumentAli Ibrahim2019-03-222-1/+7
|/ / / / / | | | | | | | | | | | | | | | | | | | | * Update #instrument to make passing a block optional. This will let users leverage #instrument for messaging in addition to instrumentation.
* | | | | Merge pull request #35617 from mattyoho/add-annotation-support-to-relationsEileen M. Uchitelle2019-03-2238-19/+645
|\ \ \ \ \ | | | | | | | | | | | | Add support for annotating queries generated by ActiveRecord::Relation with SQL comments
| * | | | | Add Relation#annotate for SQL commentingMatt Yoho2019-03-2138-19/+645
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has two main portions: 1. Add SQL comment support to Arel via Arel::Nodes::Comment. 2. Implement a Relation#annotate method on top of that. == Adding SQL comment support Adds a new Arel::Nodes::Comment node that represents an optional SQL comment and teachers the relevant visitors how to handle it. Comment nodes may be added to the basic CRUD statement nodes and set through any of the four (Select|Insert|Update|Delete)Manager objects. For example: manager = Arel::UpdateManager.new manager.table table manager.comment("annotation") manager.to_sql # UPDATE "users" /* annotation */ This new node type will be used by ActiveRecord::Relation to enable query annotation via SQL comments. == Implementing the Relation#annotate method Implements `ActiveRecord::Relation#annotate`, which accepts a comment string that will be appeneded to any queries generated by the relation. Some examples: relation = Post.where(id: 123).annotate("metadata string") relation.first # SELECT "posts".* FROM "posts" WHERE "posts"."id" = 123 # LIMIT 1 /* metadata string */ class Tag < ActiveRecord::Base scope :foo_annotated, -> { annotate("foo") } end Tag.foo_annotated.annotate("bar").first # SELECT "tags".* FROM "tags" LIMIT 1 /* foo */ /* bar */ Also wires up the plumbing so this works with `#update_all` and `#delete_all` as well. This feature is useful for instrumentation and general analysis of queries generated at runtime.