- 27 6月, 2019 1 次提交
-
-
由 eileencodes 提交于
For multiple databases we attempt to generate the tasks by reading the database.yml before the Rails application is booted. This means that we need to strip out ERB since it could be reading Rails configs. In some cases like https://github.com/rails/rails/issues/36540 the ERB is too complex and we can't overwrite with the DummyCompilier we used in https://github.com/rails/rails/pull/35497. For the complex causes we simply issue a warning that says we couldn't infer the database tasks from the database.yml. While working on this I decided to update the code to only load the database.yml once initially so that we avoid having to issue the same warning multiple times. Note that this had no performance impact in my testing and is merely for not having to save the error off somewhere. Also this feels cleaner. Note that this will not break running tasks that exist, it will just mean that tasks for multi-db like `db:create:other_db` will not be generated. If the database.yml is actually unreadable it will blow up during normal rake task calls. Fixes #36540
-
- 25 6月, 2019 1 次提交
-
-
由 Rafael França 提交于
Merge pull request #36210 from vishaltelangre/raise-record-invalid-when-associations-fail-to-save-due-to-uniqueness-failure Fix: ActiveRecord::RecordInvalid is not raised when an associated record fails to #save! due to uniqueness validation failure
-
- 24 6月, 2019 1 次提交
-
-
由 Aaron Suarez 提交于
-
- 23 6月, 2019 1 次提交
-
-
由 yuuji.yaginuma 提交于
-
- 22 6月, 2019 3 次提交
-
-
由 Akira Matsuda 提交于
-
由 Kasper Timm Hansen 提交于
-
由 Kasper Timm Hansen 提交于
Also deduplicate schema cache data when using the init_with interface
-
- 21 6月, 2019 5 次提交
-
-
由 Jean Boussier 提交于
-
由 Yuji Yaginuma 提交于
Make `ActionDispatch::Response#content_type` behavior configurable
-
由 yuuji.yaginuma 提交于
I changed return value of `ActionDispatch::Response#content_type` in #36034. But this change seems to an obstacle to upgrading. https://github.com/rails/rails/pull/36034#issuecomment-498795893 Therefore, I restored the behavior of `ActionDispatch::Response#content_type` to 5.2 and deprecated old behavior. Also, made it possible to control the behavior with the config.
-
由 Ryuta Kamizono 提交于
Address test_statement_cache_with_in_clause failure
-
由 Rafael França 提交于
Revert schema dumper to use strings rather than integers
-
- 20 6月, 2019 12 次提交
-
-
由 Yasuo Honda 提交于
This failure is occasional, does not always reproduce. ```ruby $ cd activerecord $ bundle exec rake test_postgresql ... snip ... ....F Failure: ActiveRecord::BindParameterTest#test_statement_cache_with_in_clause [/home/yahonda/git/rails/activerecord/test/cases/bind_parameter_test.rb:97]: Expected: [1, 3] Actual: [3, 1] rails test home/yahonda/git/rails/activerecord/test/cases/bind_parameter_test.rb:93 ```
-
由 eileencodes 提交于
I think we should change this, but not in 6-0-stable since that's already in RC and I was trying to only make changes that won't require any app changes. This reverts a portion of https://github.com/rails/rails/pull/36439 that made all schema migration version numbers get dumped as an integer. While it doesn't _really_ matter it did change behavior. We should bring this back in 6.1 with a deprecation.
-
由 Ryuta Kamizono 提交于
Add test cases to ensure deterministic order for ordinal methods
-
由 Yuji Yaginuma 提交于
Include BCC in the mail that sent from the development page
-
由 yuuji.yaginuma 提交于
The BCC should be included as we show input field for BCC in view. https://github.com/rails/rails/blob/bf625f7fecabbcda22b388e088ad5c29016b2385/actionmailbox/app/views/rails/conductor/action_mailbox/inbound_emails/new.html.erb#L21-L24
-
由 Yuji Yaginuma 提交于
Allow using env var to specify pidfile
-
由 Kasper Timm Hansen 提交于
Stop serializing and parsing columns_hash in Active Record schema caches
-
由 Gannon McGibbon 提交于
Autoload SyntaxErrorInTemplate
-
由 Guilherme Mansur 提交于
When a SyntaxError is detected in a template we raise this exception. On a first request to the server the exception we get a NameError since the exception is not required from `active_view/template/error.rb` yet. However later on it gets required and a second request will succeed. On the first request we see the rails "Something Wen Wrong" page and not the expected syntax error in template error page with the webconsole and stacktrace. By autoloading the constant we fix this issue. Co-authored-by: NGannon McGibbon <gannon.mcgibbon@gmail.com>
-
由 Gannon McGibbon 提交于
Better error message for calling columns_hash
-
由 Guilherme Mansur 提交于
When a record does not have a table name, as in the case for a record with `self.abstract_class = true` and no `self.table_name` set the error message raises a cryptic: "ActiveRecord::StatementInvalid: Could not find table ''" this patch now raises a new `TableNotSpecified Error` Fixes: #36274 Co-Authored-By: NEugene Kenny <elkenny@gmail.com>
-
由 Jean Boussier 提交于
-
- 19 6月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
Before 1340498d, `order` with no-op value (e.g. `nil`, `""`) had broken the contract of ordinal methods, which returns a result deterministic ordered.
-
由 Ben Thorner 提交于
Previously it was only possible to specify the location of the pidfile for the 'rails server' command with the '-P' flag. This adds support for specifying the pidfile using a PIDFILE env var, which can still be overridden by the '-P' flag and with the default pidfile path unchanged. The motivation for this feature comes from using Docker to run multiple instances of the same rails app. When developing a rails app with Docker, it's common to bind-mount the rails root directory in the running container, so that changes to files are shared between the container and the host. However, this doesn't work so well with the pidfile and it's necessary to (remember to) add a '-P' flag to the 'rails server' command line; being able to specify this flag using an env var would make developing with Rails+Docker a bit simpler.
-
由 Kasper Timm Hansen 提交于
Deduplicate various Active Record schema cache structures
-
- 18 6月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
Avoid redundant `time.getutc` call if it is already utc time object
-
由 Rafael França 提交于
Fix TranslationHelper#translate handling of Hash defaults
-
由 Ryuta Kamizono 提交于
Currently `type.serialize` and `connection.{quote|type_cast}` for a time object always does `time.getutc` call regardless of whether it is already utc time object or not, that duplicated proccess (`connection.type_cast(type.serialize(time))`) allocates extra/useless time objects for each type casting. This avoids that redundant `time.getutc` call if it is already utc time object. In the case of a model has timestamps (`created_at` and `updated_at`), it avoids 6,000 time objects allocation for 1,000 times `model.save`. ```ruby ObjectSpace::AllocationTracer.setup(%i{path line type}) pp ObjectSpace::AllocationTracer.trace { 1_000.times { User.create } }.select { |k, _| k[0].end_with?("quoting.rb", "time_value.rb") } ``` Before (c104bfe4): ``` {["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 203, :T_ARRAY]=>[1004, 0, 778, 0, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 220, :T_STRING]=>[2, 0, 2, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 209, :T_ARRAY]=>[8, 0, 8, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 57, :T_ARRAY]=>[4, 0, 4, 1, 1, 0], ["~/rails/activemodel/lib/active_model/type/helpers/time_value.rb", 17, :T_DATA]=>[4000, 0, 3096, 0, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 120, :T_DATA]=>[2000, 0, 1548, 0, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 126, :T_STRING]=>[4000, 0, 3096, 0, 1, 0]} ``` After (this change): ``` {["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 203, :T_ARRAY]=>[1004, 0, 823, 0, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 220, :T_STRING]=>[2, 0, 2, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 209, :T_ARRAY]=>[8, 0, 8, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 57, :T_ARRAY]=>[4, 0, 4, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 126, :T_STRING]=>[2000, 0, 1638, 0, 1, 0]} ```
-
- 17 6月, 2019 4 次提交
-
-
由 Ryuta Kamizono 提交于
PostgreSQL: Fix GROUP BY with ORDER BY virtual count attribute
-
由 Ryuta Kamizono 提交于
GROUP BY with virtual count attribute is invalid for almost all databases, but it is valid for PostgreSQL, and it had worked until Rails 5.2.2, so it is a regression for Rails 5.2.3 (caused by 311f0011). I can't find perfectly solution for fixing this for now, but I would not like to break existing apps, so I decided to allow referencing virtual count attribute in ORDER BY clause when GROUP BY aggrigation (it partly revert the effect of 311f0011) to fix the regression #36022. Fixes #36022.
-
由 Prem Sichanugrist 提交于
Fix typo initialzer -> initializer [ci skip]
-
由 Abhay Nikam 提交于
-
- 16 6月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
Delete method definition in rails that is compatible with ruby defini…
-
由 soartec-lab 提交于
Tests are also only on the `Time` class Update doc forgetting to erase when moved Update guide `Date` class to `Time` class and defined file Update guide correction omission
-
由 yuuji.yaginuma 提交于
Ref: bcf370d6, 06ab7b27.
-
- 15 6月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
Remove unused `Arel::Attributes.for`
-
由 Ryuta Kamizono 提交于
Delete 'ruby' in the description of the method defined in rails [skip ci]
-
由 soartec-lab 提交于
-