aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge pull request #35324 from sharang-d/patch-2"Ryuta Kamizono2019-02-191-1/+1
| | | | | | | | | | | This reverts commit 6b69ae5149f03c2f81a795c085bce56ec18535ae, reversing changes made to 84bd9adafde36d0192849649b86ffcd4e59e5e11. Reason: We already use "happen" a lots for callbacks and validations. https://github.com/rails/rails/pull/35324#issuecomment-465096483 [ci skip]
* Merge pull request #35324 from sharang-d/patch-2Vipul A M2019-02-191-1/+1
|\ | | | | Update active_record_callbacks.md [ci skip]
| * Update active_record_callbacks.md [ci skip]Sharang Dashputre2019-02-191-1/+1
|/ | | | Change 'happen' to a more technical term
* Merge pull request #35310 from kamipo/dont_allow_invalid_value_matches_to_nilRyuta Kamizono2019-02-195-8/+22
|\ | | | | Don't allow `where` with invalid value matches to nil values
| * Don't allow `where` with invalid value matches to nil valuesRyuta Kamizono2019-02-185-8/+22
| | | | | | | | | | | | | | | | | | That is considered as silently leaking information. If type casting doesn't return any actual value, it should not be matched to any record. Fixes #33624. Closes #33946.
* | Delete documentation inconsistency 'finally' for AR callbacks [ci skip] ↵Shodai Suzuki2019-02-192-2/+2
| | | | | | | | (#35303)
* | Add combining callback conditions [skip ci] (#35313)Shodai Suzuki2019-02-191-0/+14
| |
* | Merge pull request #35318 from alkesh26/actionpack-typo-fixRyuta Kamizono2019-02-191-1/+1
|\ \ | | | | | | | | | | | | Actionpack typo fix [ci skip]
| * | appropriate typo fixalkesh262019-02-191-1/+1
| |/
* / Fix preparing the configured Action Mailbox ingress in productionGeorge Claghorn2019-02-181-6/+4
|/ | | | When reloading is disabled, after_initialize hooks run after to_prepare hooks have already run for the last time. Since to_prepare hooks always run after application initializers, we don't need need to use an after_initialize hook.
* Merge pull request #29651 from Sayanc93/return-correct-dateRyuta Kamizono2019-02-183-2/+30
|\ | | | | | | Return correct date in ActiveModel for time to date conversions
| * Return correct date in ActiveModel for time to date conversionsSayan Chakraborty2017-12-173-2/+40
| | | | | | | | | | | | | | time.to_date conversion happens considering leap years so a conversion of "Day.new({'day(1i)'=>'1', 'day(2i)'=>'1', 'day(3i)'=>'1'})" results in saving the date as Mon, 03 Jan 0001 which might seem weird on the user level, hence falling back to parsing on string level resolves this data mismatch Fixes #28521
* | Extract duplicated `serialize` methods into helpersRyuta Kamizono2019-02-189-21/+17
| | | | | | | | | | | | | | | | Since `serialize` is passed user input args (from `where`, schema default, etc), a helper should provide `serialize` if the helper also provide `cast`. Related #32624, 34cc301, a741208.
* | Remove duplicated `test_update_all_with_order_and_limit`Ryuta Kamizono2019-02-181-6/+0
| | | | | | | | | | This is covered by `test_update_all_with_order_and_limit_updates_subset_only` and `test_update_all_with_order_and_limit_and_offset_updates_subset_only`.
* | Fix type cast with values hash for Date typeRyuta Kamizono2019-02-187-13/+27
| | | | | | | | | | | | | | | | `value_from_multiparameter_assignment` defined by `AcceptsMultiparameterTime` helper requires `default_timezone` method which is defined at `TimeValue` helper. Since `Date` type doesn't include `TimeValue`, I've extracted `Timezone` helper to be shared by `Date`, `DateTime`, and `Time` types.
* | upgrades Zeitwerk to 1.2.0Xavier Noria2019-02-172-3/+3
| |
* | Use placeholder for `type_condition` predicateRyuta Kamizono2019-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` SELECT "comments".* FROM "comments" WHERE "comments"."type" IN ('VerySpecialComment') AND "comments"."post_id" = ? LIMIT ? [["post_id", 4], ["LIMIT", 1]] ``` After: ``` SELECT "comments".* FROM "comments" WHERE "comments"."type" = ? AND "comments"."post_id" = ? LIMIT ? [["type", "VerySpecialComment"], ["post_id", 4], ["LIMIT", 1]] ```
* | Fix eager loading polymorphic association with mixed table conditionsRyuta Kamizono2019-02-186-26/+43
| | | | | | | | | | | | This fixes a bug that the `foreign_key` and the `foreign_type` are separated as different table conditions if a polymorphic association has a scope that joins another tables.
* | Add edge test cases for integer and string typesRyuta Kamizono2019-02-172-0/+15
| |
* | Merge pull request #35302 from yhirano55/auto_correct_rubocop_offensesRyuta Kamizono2019-02-172-12/+12
|\ \ | | | | | | Auto correct rubocop offenses
| * | Auto correct rubocop offensesYoshiyuki Hirano2019-02-172-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Offenses: railties/lib/rails/autoloaders.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true. module Rails ^ actionmailer/test/base_test.rb:917:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. actionmailer/test/base_test.rb:917:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected. actionmailer/test/base_test.rb:917:5: C: [Corrected] Style/RedundantBegin: Redundant begin block detected. begin ^^^^^ actionmailer/test/base_test.rb:918:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not 4) spaces for indentation. events = [] ^^^^ actionmailer/test/base_test.rb:930:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end. actionmailer/test/base_test.rb:930:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
* | | Merge pull request #35274 from AlexBrodianoi/fix_does_not_support_reverseRyuta Kamizono2019-02-172-1/+10
|\ \ \ | | | | | | | | Raise ActiveRecord::IrreversibleOrderError if nulls first/last is not a single ordering argument.
| * | | Raise ActiveRecord::IrreversibleOrderError if nulls first/last is not a ↵Finn Young2019-02-172-1/+10
| | | | | | | | | | | | | | | | single ordering argument.
* | | | Fix `order` with custom attributesRyuta Kamizono2019-02-174-4/+21
| | | | | | | | | | | | | | | | This follows up 0ee96d13de29680e148ccb8e5b68025f29fd091c.
* | | | Merge pull request #35299 from kamipo/fix_mismatched_foreign_keyRyuta Kamizono2019-02-173-23/+115
|\ \ \ \ | | | | | | | | | | | | | | | Fix the regex that extract mismatched foreign key information
| * | | | Fix the regex that extract mismatched foreign key informationRyuta Kamizono2019-02-173-23/+115
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CI failure for `test_errors_for_bigint_fks_on_integer_pk_table` is due to the poor regex that extract all ``` `(\w+)` ``` like parts from the message (`:foreign_key` should be `"old_car_id"`, but `"engines"`): https://travis-ci.org/rails/rails/jobs/494123455#L1703 I've improved the regex more strictly and have more exercised mismatched foreign key tests. Fixes #35294
* | | | Merge pull request #35297 from yhara/fix-ar-connection-handler-leakRyuta Kamizono2019-02-161-7/+11
|\ \ \ \ | |_|/ / |/| | | | | | | Fix possible memory leak of ConnectionHandler
| * | | Fix possible memory leak of ConnectionHandlerYutaka HARA2019-02-161-7/+11
| | | | | | | | | | | | | | | | refs #35296
* | | | Merge pull request #35281 from ↵Aaron Patterson2019-02-152-5/+16
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | y-yagi/show_deprecated_message_instead_of_raise_exception Show deprecated message instead of raise exception in `compiled_method_container` method
| * | | | Show deprecated message instead of raise exception in ↵yuuji.yaginuma2019-02-162-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `compiled_method_container` method Since #35036, the subclasses of `ActionView::Base` requires the `compiled_method_container`. This is incompatible. For example, `web-console` use view class that subclass of `ActionView::Base`, and does not work it now cause of this. Actually, since it seems that it is only `ActionView::Base` that `compiled_method_container` is necessary, modified the condition that emits a warning.
* | | | | Remove `NoForeignKeySupportTest` which is no longer reachedRyuta Kamizono2019-02-162-46/+0
| | | | | | | | | | | | | | | | | | | | Since #35212, foreign key feature is supported by all adapters.
* | | | | Refactor `remove_foreign_key` to delete the foreign key before `alter_table`Ryuta Kamizono2019-02-161-4/+2
| |/ / / |/| | |
* | | | Add changelog entry for #35212Ryuta Kamizono2019-02-161-0/+4
| | | | | | | | | | | | | | | | [ci skip]
* | | | Merge pull request #35286 from matthewdunbar/masterRyuta Kamizono2019-02-162-0/+18
|\ \ \ \ | | | | | | | | | | | | | | | Properly handle cached queries with too many bind parameters
| * | | | Properly handle cached queries with too many bind parametersMatthew Dunbar2019-02-142-0/+16
| | | | |
* | | | | Merge pull request #35269 from y-yagi/allow_to_pass_options_to_csp_meta_tagYuji Yaginuma2019-02-162-2/+8
|\ \ \ \ \ | | | | | | | | | | | | Allow to pass options to `csp_meta_tag`
| * | | | | Allow to pass options to `csp_meta_tag`yuuji.yaginuma2019-02-162-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `csp_meta_tag` generates `name` attribute only. However, in libraries like `Material-UI` and `JSS`, expect that the meta tag that contains the nonce with `property` attribute. https://material-ui.com/css-in-js/advanced/#how-does-one-implement-csp https://github.com/cssinjs/jss/blob/master/docs/csp.md This patch allows `csp_meta_tag` to specify arbitrary options and allows `nonce` to be passed to those libraries.
* | | | | | Implement AS::Dependencies.verbose= compatibility for :zeitwerk modeXavier Noria2019-02-152-0/+41
| | | | | |
* | | | | | Merge pull request #35289 from LinkUpStudioUA/masterRafael França2019-02-151-0/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | AbstractController::Translation#t: dup options
| * | | | | | AbstractController::Translation#t: dup optionsNazar Matus2019-02-151-0/+1
| | | | | | |
* | | | | | | Merge pull request #35262 from gmcgibbon/reword_ar_rdbms_noteGannon McGibbon2019-02-151-1/+1
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Reword RDBMS note in ActiveRecord basics
| * | | | | | Reword RDBMS note in ActiveRecord basicsGannon McGibbon2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | Merge pull request #35288 from conradbeach/fix-typosVipul A M2019-02-152-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix Small Typo in Docs [ci skip]
| * | | | | | | Fix small typo in docs Conrad Beach2019-02-152-2/+2
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | Merge pull request #35280 from kamipo/deprecate_leaking_scopeRyuta Kamizono2019-02-159-33/+88
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Deprecate using class level querying methods if the receiver scope regarded as leaked
| * | | | | | | Deprecate using class level querying methods if the receiver scope regarded ↵Ryuta Kamizono2019-02-156-21/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as leaked This deprecates using class level querying methods if the receiver scope regarded as leaked, since #32380 and #35186 may cause that silently leaking information when people upgrade the app. We need deprecation first before making those.
| * | | | | | | Revert "Merge pull request #35186 from ↵Ryuta Kamizono2019-02-156-37/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/fix_leaking_scope_on_relation_create" This reverts commit b67d5c6dedbf033515a96a95d24d085bf99a0d07, reversing changes made to 2e018361c7c51e36d1d98bf770b7456d78dee68b. Reason: #35186 may cause that silently leaking information when people upgrade the app. We need deprecation first before making this.
* | | | | | | | Replace autoloader accessors with Rails.autoloaders.{main,once}Xavier Noria2019-02-148-50/+72
| |_|_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails.autoloader and Rails.once_autoloader was just tentative API good enough for a first patch. Rails.autoloader is singular and does not convey in its name that there is another autoloader. That might be confusing, for example if you set a logger and miss traces. On the other hand, the name `once_autoloader` is very close to being horrible. Rails.autoloaders.main and Rails.autoloaders.once read better for my taste, and have a nice symmetry. Also, both "main" and "once" are four letters long, short and same length. They are tagged as "rails.main" and "rails.once", respectively. References #35235.
* | | | | | | Merge pull request #35279 from yahonda/pg_channel_prefixMatthew Draper2019-02-151-0/+1
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Address uninitialized constant PostgresqlAdapterTest::ChannelPrefixTest (NameError)
| * | | | | | Address uninitialized constant PostgresqlAdapterTest::ChannelPrefixTest ↵Yasuo Honda2019-02-151-0/+1
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (NameError) ``` $ bundle exec ruby -w -Itest test/subscription_adapter/postgresql_test.rb Traceback (most recent call last): 1: from test/subscription_adapter/postgresql_test.rb:8:in `<main>' test/subscription_adapter/postgresql_test.rb:10:in `<class:PostgresqlAdapterTest>': uninitialized constant PostgresqlAdapterTest::ChannelPrefixTest (NameError) ``` https://travis-ci.org/rails/rails/jobs/493530508 Follow up #35276