aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | How to use `select` is updated [ci skip]soartec-lab2019-02-241-0/+2
| | | |
* | | | Disable available locale checks in Action Test testyuuji.yaginuma2019-02-241-0/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Without this change, `store_translations` silently fails when available locales already initialized. Ref: https://travis-ci.org/rails/rails/jobs/497615616#L6846 https://travis-ci.org/rails/rails/jobs/497605027#L6856
* | | Merge pull request #35382 from ↵George Claghorn2019-02-232-48/+62
|\ \ \ | | | | | | | | | | | | | | | | janko/restore-io-copy-stream-compatibility-with-uploaded-file Restore ActionDispatch::Http::UploadedFile compatibility with IO.copy_stream
| * | | Restore UploadedFile compatibility with IO.copy_streamJanko Marohnić2019-02-232-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In https://github.com/rails/rails/pull/28676 the `#to_path` method was added to `ActionDispatch::Http::UploadedFile`. This broke usage with `IO.copy_stream`: source = ActionDispatch::Http::UploadedFile.new(...) IO.copy_stream(source, destination) # ~> TypeError: can't convert ActionDispatch::Http::UploadedFile to IO (ActionDispatch::Http::UploadedFile#to_io gives Tempfile) Normally `IO.copy_stream` just calls `#read` on the source object. However, when `#to_path` is defined, `IO.copy_stream` calls `#to_io` in order to retrieve the raw `File` object. In that case it trips up, because `ActionDispatch::Http::UploadedFile#to_io` returned a `Tempfile` object, which is not an `IO` subclass. We fix this by having `#to_io` return an actual `File` object.
| * | | Test ActionDispatch::Http::UploadedFile with an actual TempfileJanko Marohnić2019-02-231-48/+48
| | | |
* | | | Make this test strongerXavier Noria2019-02-231-0/+7
| | | | | | | | | | | | | | | | | | | | We test the inflections for both autoloaders, but we can also autoload the constant as a sort of integration test.
* | | | Add test case for `unscope` with unknown columnRyuta Kamizono2019-02-241-0/+11
| | | |
* | | | More exercise tests for distinct count with group byRyuta Kamizono2019-02-241-2/+16
| | | |
* | | | Let Zeitwerk autoloaders inflect with Active SupportXavier Noria2019-02-232-2/+32
|/ / / | | | | | | | | | [Harry Brundage & Xavier Noria]
* | | Merge pull request #35379 from shivamvinsol/minor_grammar_fixRyuta Kamizono2019-02-241-1/+1
|\ \ \ | | | | | | | | minor grammar fix [ci skip]
| * | | minor grammar fix [ci skip]Shivam Jain2019-02-241-1/+1
|/ / /
* | | Upgrade Zeitwerk to 1.3.1Xavier Noria2019-02-232-3/+3
| | |
* | | Merge pull request #35374 from rails/cache-inline-templatesAaron Patterson2019-02-223-1/+24
|\ \ \ | | | | | | | | Add a finalizer to inline templates
| * | | Add a finalizer to inline templatesAaron Patterson2019-02-223-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a finalizer just to inline templates. We can't cache compilation of inline templates because it's possible that people could have render calls that look like this: ```ruby loop do render inline: "#{rand}" end ``` and we would cache every one of these different inline templates. That would cause a memory leak. OTOH, we don't need finalizers on regular templates because we can cache, control, and detect changes to the template source. Fixes: #35372
* | | | Merge pull request #35375 from ↵Yuji Yaginuma2019-02-231-7/+2
|\ \ \ \ | |/ / / |/| | | | | | | | | | | y-yagi/fix_test_select_with_subquery_in_from_uses_original_table_name Make `test_select_with_subquery_in_from_uses_original_table_name` work with old SQLite3
| * | | Make `test_select_with_subquery_in_from_uses_original_table_name` work with ↵yuuji.yaginuma2019-02-231-7/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | old SQLite3 It seems that the reason why the `test_select_with_subquery_in_from_uses_original_table_name` does not pass is that the return value of `sqlite3_column_name()` is wrong due to subquery flattening. This seems to have been fixed with SQLite 3.20.0(https://sqlite.org/changes.html#version_3_20_0). But CI uses the old version(maybe 3.11.0), I added `DISTINCT` to avoid optimization by subquery flattening. Ref: https://sqlite.org/optoverview.html#flattening
* | | Merge pull request #35367 from ↵Rafael França2019-02-221-2/+2
|\ \ \ | | | | | | | | | | | | | | | | abhaynikam/update-getting-started-doc-for-migration-version-in-rails-6 Update migration version to 6.0 in the getting started doc [ci skip]
| * | | [ci skip] Updated migration version to 6.0 in the getting started docsAbhay Nikam2019-02-221-2/+2
| | | |
* | | | Merge pull request #35370 from shivamvinsol/fix_skip_callbacks_documentationRyuta Kamizono2019-02-231-3/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Update callbacks skipping methods in guide. [ci skip]
| * | | | update callbacks skipping methods in guide [ci skip]Shivam Jain2019-02-231-3/+2
| | | | |
* | | | | Merge pull request #35371 from rails/always-have-a-formatAaron Patterson2019-02-224-7/+18
|\ \ \ \ \ | | | | | | | | | | | | Ensure that rendered templates always have a format
| * | | | | Ensure that rendered templates always have a formatAaron Patterson2019-02-224-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes one call to `lookup_context` and also eliminates a conditional in `_render_template`.
* | | | | | Skip `test_select_with_subquery_in_from_uses_original_table_name` on CIRyuta Kamizono2019-02-231-1/+1
| |/ / / / |/| | | | | | | | | | | | | | Somehow `ENV["BUILDKITE"]` didn't work as expected.
* | | | | Merge pull request #35369 from rails/fewer-lookup-context-callsAaron Patterson2019-02-222-6/+6
|\ \ \ \ \ | |_|/ / / |/| | | | Pass lookup context to the layout handlers
| * | | | Pass lookup context to the layout handlersAaron Patterson2019-02-222-6/+6
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | I want to start reducing the calls to `lookup_context`. That method caches the lookup context in an ivar, but I would like to cache the lookup context on the stack. That way we aren't coupled to the behavior of the `lookup_context` method.
* | | | Skip `test_select_with_subquery_in_from_uses_original_table_name` on ↵Ryuta Kamizono2019-02-221-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Buildkite as well https://buildkite.com/rails/rails/builds/58981#2423c707-7c56-4639-a76e-8db4fd1e5cf3/102-111
* | | | Merge pull request #35357 from ↵George Claghorn2019-02-222-2/+52
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | abhaynikam/35351-allows-rich-text-area-to-have-translated-placeholder Allows rich_text_area_tag to add translated placeholder text if placeholder option set to true
| * | | | Allows rich_text_area_tag to add I18n translated placeholder text if ↵Abhay Nikam2019-02-222-2/+52
| |/ / / | | | | | | | | | | | | placeholder option set to true
* | | | Prefer I18n.with_localeGeorge Claghorn2019-02-212-52/+37
| | | |
* | | | Merge pull request #35363 from rails/zeitwerk-1.3.0Xavier Noria2019-02-215-12/+11
|\ \ \ \ | | | | | | | | | | Bumps Zeitwerk
| * | | | simplifies Rails.autoloaders.logger=Xavier Noria2019-02-212-4/+3
| | | | | | | | | | | | | | | | | | | | Possible thanks to Zeitwerk 1.3.0.
| * | | | simplify AS::Dependencies.verbose=Xavier Noria2019-02-212-5/+5
| | | | | | | | | | | | | | | | | | | | Possible thanks to Zeitwerk 1.3.0.
| * | | | bump ZeitwerkXavier Noria2019-02-212-3/+3
| |/ / /
* | | | Merge pull request #35360 from kamipo/fix_select_and_pluck_with_fromRyuta Kamizono2019-02-222-1/+42
|\ \ \ \ | |/ / / |/| | | Fix `pluck` and `select` with `from` if `from` has original table name
| * | | Just skip `test_select_with_subquery_in_from_uses_original_table_name` on TravisRyuta Kamizono2019-02-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm not sure why the test is failed on Travis, it passed on locally. I suspect that failure is a bug on SQLite3, so just skip the test for now, since it was not covered by before. https://travis-ci.org/rails/rails/jobs/496726410#L1198-L1208
| * | | Fix `pluck` and `select` with `from` if `from` has original table nameRyuta Kamizono2019-02-222-1/+39
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is caused by 0ee96d1. Since #18744, `select` columns doesn't be qualified by table name if using `from`. 0ee96d1 follows that for `pluck` as well. But people depends that `pluck` columns are qualified even if using `from`. So I've fixed that to be qualified if `from` has the original table name to keep the behavior as much as before. Fixes #35359.
* / / Should not pass extra args to `_update_record`Ryuta Kamizono2019-02-213-7/+13
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The argument of `_update_record` and `_create_record` is `attribute_names`, that is reserved for overriding by partial writes attribute names. https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/persistence.rb#L719 https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/persistence.rb#L737 https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/attribute_methods/dirty.rb#L171 https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/attribute_methods/dirty.rb#L177 The reason that no failing with extra args is that `Timestamp` module which is most outside module of the `_update_record` discards the extra args. https://github.com/rails/rails/blob/67e20d1d4854d834e9e43e56486d37cd98983f0d/activerecord/lib/active_record/timestamp.rb#L104 But that looks odd dependency. It should not be passed extra args, should only be passed attribute names.
* | Merge pull request #35349 from rails/autoloaders.logger=Xavier Noria2019-02-212-0/+28
|\ \ | | | | | | Define Rails.autoloaders.logger=
| * | Define Rails.autoloaders.logger=Xavier Noria2019-02-212-0/+28
| | |
* | | Merge pull request #35336 from ↵Ryuta Kamizono2019-02-215-9/+23
|\ \ \ | |/ / |/| | | | | | | | kamipo/dont_allow_non_numeric_string_matches_to_zero Don't allow `where` with non numeric string matches to 0 values
| * | Don't allow `where` with non numeric string matches to 0 valuesRyuta Kamizono2019-02-205-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up of #35310. Currently `Topic.find_by(id: "not-a-number")` matches to a `id = 0` record. That is considered as silently leaking information. If non numeric string is given to find by an integer column, it should not be matched to any record. Related #12793.
* | | Address "warning: in `column': the last argument was passed as a single Hash"Ryuta Kamizono2019-02-213-11/+12
| | |
* | | Extract `default_uniqueness_comparison` to ease to handle mismatched ↵Ryuta Kamizono2019-02-212-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | collation issues In MySQL, the default collation is case insensitive. Since the uniqueness validator enforces case sensitive comparison by default, it frequently causes mismatched collation issues (performance, weird behavior, etc) to MySQL users. https://grosser.it/2009/12/11/validates_uniqness_of-mysql-slow/ https://github.com/rails/rails/issues/1399 https://github.com/rails/rails/pull/13465 https://github.com/gitlabhq/gitlabhq/commit/c1dddf8c7d947691729f6d64a8ea768b5c915855 https://github.com/huginn/huginn/pull/1330#discussion_r55152573 This extracts `default_uniqueness_comparison` to ease to handle the mismatched collation issues on the connection.
* | | Merge pull request #35345 from soartec-lab/fix_lint_activerecord_relationRyuta Kamizono2019-02-211-3/+3
|\ \ \ | | | | | | | | Fix lint `ShadowingOuterLocalVariable`
| * | | Fix lint `ShadowingOuterLocalVariable`soartec-lab2019-02-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "Fix lint `ShadowingOuterLocalVariable`" This reverts commit 38bd45a48992b500478a82d56d31468a322937a8. Change of variable name Fix lint `ShadowingOuterLocalVariable`
* | | | Revert "Speed up integer casting from DB"Ryuta Kamizono2019-02-212-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 52fddcc653458456f98b3683dffd781cf00b35fe. 52fddcc was to short-circuit `ensure_in_range` in `cast_value`. But that caused a regression for empty string deserialization. Since 7c6f393, `ensure_in_range` is moved into `serialize`. As 52fddcc said, the absolute gain is quite small. So I've reverted that commit to fix the regression.
* | | | Merge pull request #35344 from eugeneius/active_storage_require_core_extGeorge Claghorn2019-02-201-0/+1
|\ \ \ \ | |/ / / |/| | | Add missing require to active_storage.rb
| * | | Add missing require to active_storage.rbEugene Kenny2019-02-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since b21f50d8ae36d9b50b673579e17bccbe55363b34, requiring active_storage on its own has failed with the following error: activestorage/lib/active_storage.rb:55:in `<module:ActiveStorage>': undefined method `minutes' for 5:Integer (NoMethodError)
* | | | Explains a detail re eager loading [ci skip]Xavier Noria2019-02-201-0/+3
|/ / /
* | | Merge pull request #35342 from alkesh26/actionview-typo-fixesVipul A M2019-02-212-2/+2
|\ \ \ | | | | | | | | [ci skip] actionview typo fixes.