aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #29814 from kamipo/dont_cache_scope_for_createKasper Timm Hansen2017-07-164-14/+6
|\ | | | | Don't cache `scope_for_create`
| * Don't cache `scope_for_create`Ryuta Kamizono2017-07-164-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I investigated where `scope_for_create` is reused in tests with the following code: ```diff --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -590,6 +590,10 @@ def where_values_hash(relation_table_name = table_name) end def scope_for_create + if defined?(@scope_for_create) && @scope_for_create + puts caller + puts "defined" + end @scope_for_create ||= where_values_hash.merge!(create_with_value.stringify_keys) end ``` It was hit only `test_scope_for_create_is_cached`. This means that `scope_for_create` will not be reused in normal use cases. So we can remove caching `scope_for_create` to respect changing `where_clause` and `create_with_value`.
* | Merge pull request #29358 from robin850/dbconsole-connectionKasper Timm Hansen2017-07-166-19/+128
|\ \ | | | | | | Allow to pass a connection to the `dbconsole` command
| * | Properly expand the environment's nameRobin Dupret2017-07-166-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Running the `console` and `dbconsole` commands with a regular argument as the environment's name automatically expand it to match an existing environment (e.g. dev for development). This feature wasn't available using the `--environment` (a.k.a `-e`) option.
| * | Deprecate environment as an argument for dbconsole and consoleRobin Dupret2017-07-164-12/+44
| | | | | | | | | | | | | | | | | | People should rather rely on the `-e` or `--environment` options to specify in which environment they want to work. This will allow us to specify the connection to pick as a regular argument in the future.
| * | Allow to pass a connection to the `dbconsole` commandRobin Dupret2017-07-163-2/+64
| |/ | | | | | | | | | | | | | | | | | | | | Since 0a4f6009, it's possible to specify a 3-level database configuration to gather connections by environment. The `dbconsole` command will try to look for a database configuration which points to the current environment but with such flavour, the environment key is flushed out so let's add the ability to specify the connection and pick `primary` by default to be consistent with Active Record.
* | Fix root not being defined on Travis.Kasper Timm Hansen2017-07-161-1/+6
| |
* | explain why require_relative is not used here [ci skip]Xavier Noria2017-07-161-0/+2
| |
* | Fix code formatting for QueryMethods#selectRobin Dupret2017-07-161-2/+3
| | | | | | | | [ci skip]
* | Merge pull request #29817 from koic/replace_erubis_with_erubi_in_guideRyuta Kamizono2017-07-161-1/+1
|\ \ | |/ |/| Replace Erubis with Erubi in a part of guide [ci skip]
| * Replace Erubis with Erubi in a part of guide [ci skip]Koichi ITO2017-07-161-1/+1
| |
* | Merge pull request #29809 from kamipo/remove_unused_ivarsKasper Timm Hansen2017-07-161-2/+1
|\ \ | |/ |/| Remove unused `@last`, `@order_clause`, and `@join_dependency`
| * Remove unused `@last`, `@order_clause`, and `@join_dependency`Ryuta Kamizono2017-07-161-2/+1
| | | | | | | | | | | | Using `@last` and `@order_clause` was removed at 8bb5274 and 90d1524. `@join_dependency` was added at b959950 but it is unused in the first place.
* | Merge pull request #29771 from ↵Kasper Timm Hansen2017-07-169-22/+24
|\ \ | |/ |/| | | | | kamipo/fix_create_with_using_both_string_and_symbol Fix `create_with` using both string and symbol
| * Fix `create_with` using both string and symbolRyuta Kamizono2017-07-169-18/+20
| | | | | | | | | | | | | | This is related with #27680. Since `where_values_hash` keys constructed by `where` are string, so we need `stringify_keys` to `create_with_value` before merging it.
| * Use `where(id: 10)` rather than `where(relation.table[:id].eq(10))`Ryuta Kamizono2017-07-161-5/+5
|/ | | | | Because Arel is a private API and to describe `where_values_hash` keys constructed by `where` are string.
* Merge pull request #29645 from y-yagi/check_component_when_run_app_updateKasper Timm Hansen2017-07-165-23/+60
|\ | | | | Do not generate unused components contents in `app:update` task
| * Do not generate unused components contents in `app:update` taskyuuji.yaginuma2017-07-165-23/+60
| | | | | | | | | | | | | | | | | | | | | | | | Currently, `app:update` generates all contents regardless of the component using in application. For example, even if not using Action Cable, `app:update` will generate a contents related to Action Cable. This is a little inconvenient. This PR checks the existence of the component and does not generate unnecessary contents. Can not check all options in this way. However, it will be able to prevent the generation of unnecessary files.
* | Merge pull request #29806 from yhirano55/remove_blank_line_in_setupKasper Timm Hansen2017-07-161-2/+3
|\ \ | |/ |/| Remove blank lines in setup
| * Remove blank lines in setupYoshiyuki Hirano2017-07-161-2/+3
| |
* | Merge pull request #29679 from kamipo/add_test_case_for_27724Kasper Timm Hansen2017-07-152-0/+12
|\ \ | | | | | | Add a test case for overwriting existing condition on associations
| * | Add a test case for overwriting existing condition on associationsRyuta Kamizono2017-07-072-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Overwriting existing condition on associations has already supported (23bcc65 for eager loading, 2bfa2c0 for preloading). Fixes #27724. Closes #29154.
* | | Merge pull request #29769 from kamipo/remove_extra_order_for_firstKasper Timm Hansen2017-07-152-32/+28
|\ \ \ | | | | | | | | Remove extra `.merge!(order: "id")` for `Relation#first` in tests
| * | | Remove extra `.merge!(order: "id")` for `Relation#first` in testsRyuta Kamizono2017-07-132-32/+28
| | | | | | | | | | | | | | | | | | | | Since 07e5301, `Relation#first` will order by primary key if no order is defined.
* | | | Merge pull request #29770 from y-yagi/fix_boolean_column_migration_scriptKasper Timm Hansen2017-07-153-3/+3
|\ \ \ \ | | | | | | | | | | Fix boolean column migration script
| * | | | Fix boolean column migration scriptyuuji.yaginuma2017-07-133-3/+3
| | | | |
* | | | | Merge pull request #29802 from EmmaB/masterKasper Timm Hansen2017-07-151-4/+4
|\ \ \ \ \ | | | | | | | | | | | | Remove redundant instances of the word 'simply'
| * | | | | Remove redundant instances of the word 'simply' from documentation, on the ↵Emma Barnes2017-07-151-4/+4
|/ / / / / | | | | | | | | | | | | | | | basis that if it was simple, the user wouldn't be reading the docs
* | | | | Merge pull request #29798 from kamipo/remove_useless_aliased_table_nameKasper Timm Hansen2017-07-154-18/+1
|\ \ \ \ \ | | | | | | | | | | | | Remove useless `aliased_table_name` in `JoinDependency`
| * | | | | Remove useless `aliased_table_name` in `JoinDependency`Ryuta Kamizono2017-07-154-18/+1
| | |_|_|/ | |/| | | | | | | | | | | | | If `table.table_alias` is not nil, it is enough to use `table` simply.
* | | | | Merge pull request #29800 from koic/remove_encoding_utf8_magic_commentKasper Timm Hansen2017-07-152-2/+0
|\ \ \ \ \ | | | | | | | | | | | | Remove encoding utf-8 magic comment
| * | | | | Remove encoding utf-8 magic commentKoichi ITO2017-07-152-2/+0
|/ / / / /
* | | | | Merge pull request #29797 from y-yagi/fix_doc_format_for_time_helpersRyuta Kamizono2017-07-151-2/+2
|\ \ \ \ \ | |/ / / / |/| | | | Fix doc format for `ActiveSupport::Testing::TimeHelpers` [ci skip]
| * | | | Fix doc format for `ActiveSupport::Testing::TimeHelpers` [ci skip]yuuji.yaginuma2017-07-151-2/+2
| |/ / /
* | | | Merge pull request #29786 from willnet/remove-javascript_link_tag-optionsRyuta Kamizono2017-07-141-32/+0
|\ \ \ \ | | | | | | | | | | [ci skip]Remove options of javascript_link_tag and stylesheet_link_tag in guides
| * | | | [ci skip]Remove options of javascript_link_tag and stylesheet_link_tag in guideswillnet2017-07-141-32/+0
|/ / / /
* | | | Merge pull request #29772 from ↵Kasper Timm Hansen2017-07-131-1/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | y-yagi/allow_to_edit_secrets_in_mutiple_applications_at_the_same_time Allow to edit secrets in mutiple apps at the same time
| * | | | Allow to edit secrets in mutiple apps at the same timeyuuji.yaginuma2017-07-131-1/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In encrypted secrets, the tmp file is used as a fixed file (`secrets.yml.enc` under the tmp directory). And that tmp file will be removed after process. Therefore, if edit secrets at the same time with multiple applications, the tmp file was conflicting. In order to avoid the above issue, added pid to tmp file.
* | | | Merge pull request #29778 from yui-knk/fix_charset_docप्रथमेश Sonpatki2017-07-131-1/+1
|\ \ \ \ | |/ / / |/| | | [ci skip] `Response#charset=` uses `default_charset` when `nil` is passed
| * | | `Response#charset=` uses `default_charset` when `nil` is passedyui-knk2017-07-131-1/+1
|/ / /
* | | Merge pull request #29699 from lugray/represent_boolean_as_integerMatthew Draper2017-07-1212-8/+148
|\ \ \ | | | | | | | | Change sqlite3 boolean serialization to use 1 and 0
| * | | Change sqlite3 boolean serialization to use 1 and 0Lisa Ugray2017-07-1112-8/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Abstract boolean serialization has been using 't' and 'f', with MySQL overriding that to use 1 and 0. This has the advantage that SQLite natively recognizes 1 and 0 as true and false, but does not natively recognize 't' and 'f'. This change in serialization requires a migration of stored boolean data for SQLite databases, so it's implemented behind a configuration flag whose default false value is deprecated. The flag itself can be deprecated in a future version of Rails. While loaded models will give the correct result for boolean columns without migrating old data, where() clauses will interact incorrectly with old data. While working in this area, also change the abstract adapter to use `"TRUE"` and `"FALSE"` as quoted values and `true` and `false` for unquoted. These are supported by PostreSQL, and MySQL remains overriden.
* | | | Merge pull request #29764 from georgeclaghorn/third-party-cache-store-configMatthew Draper2017-07-121-1/+1
|\ \ \ \ | | | | | | | | | | Fix configuring third-party cache stores such as ActiveSupport::Cache::RedisStore
| * | | | Fix configuring third-party cache stores such as ↵George Claghorn2017-07-121-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | ActiveSupport::Cache::RedisStore Broken in 8da30ad.
* | | | normalize_path used to be nil tolerantAkira Matsuda2017-07-122-0/+5
| | | | | | | | | | | | | | | | fixes a regression introduced at 8607c25ba7810573733d9b37d0015154ba059f5e
* | | | Merge pull request #29746 from kamipo/extract_fake_klassRafael França2017-07-113-52/+38
|\ \ \ \ | | | | | | | | | | Extract `FakeKlass` in `relation_test.rb` and `relation/mutation_test.rb`
| * | | | Extract `FakeKlass` in `relation_test.rb` and `relation/mutation_test.rb`Ryuta Kamizono2017-07-113-52/+38
| | |/ / | |/| | | | | | | | | | | | | | `FakeKlass` in `relation_test.rb` and `relation/mutation_test.rb` are almost the same.
* | | | Merge pull request #29748 from koic/enable_layout_empty_line_after_magic_commentRafael França2017-07-11547-0/+549
|\ \ \ \ | | | | | | | | | | Enable Layout/EmptyLineAfterMagicComment cop
| * | | | [Action Record] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-113-0/+3
| | | | |
| * | | | [Action View] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-113-0/+3
| | | | |